derek-adair/nfldb

Historical team / position data for players

derek-adair opened this issue · 2 comments

Currently the player model only reflects the current state of a player. This will require two extra tables;

player_position
player_team

Example:
It looks like Tom Brady played for tampa bay in 2012

>>> q.game(season_year=2012, season_type='Regular')
<nfldb.query.Query object at 0x7f2271968470>
>>> for pp in q.sort('passing_yds').limit(5).as_aggregate():
...     print ( pp.player, pp.passing_yds )
...
Drew Brees (NO, QB) 5177
Matthew Stafford (DET, QB) 4965
Tony Romo (UNK, UNK) 4903
**Tom Brady (TB, QB) 4799**
Matt Ryan (ATL, QB) 4719

VERY possible i am mistaken on this. It looks like you can get this data in PlayPlayer.

I'm sorry for doubting you oh great and powerful Burnt Sushi...

>>> import nfldb
>>> db = nfldb.connect()
>>> q = nfldb.Query(db)
>>> q.game(season_year=2012, season_type='Regular')
>>> for pp in q.sort('passing_yds').limit(5).as_play_players():
...     print( pp.player.full_name, pp.team)
...
Josh Freeman TB
Robert Griffin III WAS
Tony Romo DAL
Tom Brady NE
Ben Roethlisberger PIT