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

Class Game

source code

object --+
         |
        Game

Game represents a single pre- or regular-season game. It provides a window into the statistics of every player that played into the game, along with the winner of the game, the score and a list of all the scoring plays.

Instance Methods
 
__init__(self, eid)
Creates a new Game instance given a game identifier.
source code
 
game_over(self)
game_over returns true if the game is no longer being played.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  eid = 0
The identifier of the player used by NFL's GameCenter live update.
  players = None
A sequence of all players that can be searched, sorted and filtered.
  data = None
The raw decoded JSON.
  home = ''
Abbreviation for the home team.
  away = ''
Abbreviation for the away team.
  score_home_final = 0
Final score for the home team.
  score_away_final = 0
Final score for the away team.
  winner = ''
Abbreviated team name of the winner of the game.
  scores = []
A list of scoring plays in the order in which they occurred.
Properties

Inherited from object: __class__

Method Details

__init__(self, eid)
(Constructor)

source code 

Creates a new Game instance given a game identifier.

The game identifier is used by NFL.com's GameCenter live update web pages. It is used to construct a URL to download JSON data for the game.

If the game has been completed, the JSON data will be cached to disk so that subsequent accesses will not re-download the data but instead read it from disk.

When the JSON data is written to disk, it is compressed using gzip.

Overrides: object.__init__