Package nflgame :: Module game
[frames] | no frames]

Module game

source code

Classes
  GameDiff
Represents the difference between two points in time of the same game in terms of plays and player statistics.
  TeamStats
A collection of team statistics for an entire game.
  FieldPosition
Represents field position.
  PossessionTime
Represents the amount of time a drive lasted in (minutes, seconds).
  GameClock
Represents the current time in a game.
  Game
Game represents a single pre- or regular-season game.
  Drive
Drive represents a single drive in an NFL game.
  Play
Play represents a single play.
Functions
 
diff(before, after)
Returns the difference between two points of time in a game in terms of plays and player statistics.
source code
Variables
  __package__ = 'nflgame'
Function Details

diff(before, after)

source code 

Returns the difference between two points of time in a game in terms of plays and player statistics. The return value is a GameDiff namedtuple with two attributes: plays and players. Each contains *only* the data that is in the after game but not in the before game.

This is useful for sending alerts where you're guaranteed to see each play statistic only once (assuming NFL.com behaves itself).

XXX: There is an assertion that requires after's game clock be the same or later than before's game clock. This may need to be removed if NFL.com allows its game clock to be rolled back due to corrections from refs.