Package nflgame :: Module seq :: Class GenPlayerStats
[frames] | no frames]

Class GenPlayerStats

source code

object --+    
         |    
       Gen --+
             |
            GenPlayerStats

GenPlayerStats implements a sequence type and provides a convenient API for searching sets of player statistics.

Instance Methods
 
name(self, name)
Returns a single player whose name equals `name`.
source code
 
playerid(self, playerid)
Returns a single player whose NFL GameCenter identifier equals `playerid`.
source code
 
touchdowns(self)
touchdowns is a convenience method for returning a Players sequence of all players with at least one touchdown.
source code
 
passing(self)
Returns players that have a "passing" statistical category.
source code
 
rushing(self)
Returns players that have a "rushing" statistical category.
source code
 
receiving(self)
Returns players that have a "receiving" statistical category.
source code
 
fumbles(self)
Returns players that have a "fumbles" statistical category.
source code
 
kicking(self)
Returns players that have a "kicking" statistical category.
source code
 
punting(self)
Returns players that have a "punting" statistical category.
source code
 
kickret(self)
Returns players that have a "kickret" statistical category.
source code
 
puntret(self)
Returns players that have a "puntret" statistical category.
source code
 
defense(self)
Returns players that have a "defense" statistical category.
source code
 
penalty(self)
Returns players that have a "penalty" statistical category.
source code
 
csv(self, fileName)
Given a file-name fileName, csv will write the contents of the Players sequence to fileName formatted as comma-separated values.
source code
 
__add__(self, other)
Adds two sequences of players by combining repeat players and summing their statistics.
source code

Inherited from Gen: __init__, __iter__, __reversed__, __str__, filter, limit, sort

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

Properties

Inherited from object: __class__

Method Details

name(self, name)

source code 

Returns a single player whose name equals `name`. If no such player can be found, None is returned.

Note that NFL GameCenter formats their names like "T.Brady" and "W.Welker". Thus, `name` should also be in this format.

playerid(self, playerid)

source code 

Returns a single player whose NFL GameCenter identifier equals `playerid`. This probably isn't too useful, unless you're trying to do ID mapping. (Players have different identifiers across NFL.com.)

If no such player with the given identifier is found, None is returned.

csv(self, fileName)

source code 

Given a file-name fileName, csv will write the contents of the Players sequence to fileName formatted as comma-separated values. The resulting file can then be opened directly with programs like Excel, Google Docs, Libre Office and Open Office.

Note that since each player in a Players sequence may have differing statistical categories (like a quarterback and a receiver), the minimum constraining set of statisical categories is used as the header row for the resulting CSV file.