BurntSushi / nflgame

An API to retrieve and read NFL Game Center JSON data. It can work with real-time data, which can be used for fantasy football.
http://pdoc.burntsushi.net/nflgame
The Unlicense
1.27k stars 412 forks source link

Metrics lookup #369

Closed OD1995 closed 5 years ago

OD1995 commented 5 years ago

I am a newbie to NFL and as a result many of the metric names are fairly confusing to me. Is there anywhere that gives a longer title (or explanation) to each of the metrics, e.g. kicking_xpb or defense_sk?

ochawkeye commented 5 years ago

https://github.com/BurntSushi/nflgame/wiki/Stat-types

OD1995 commented 5 years ago

That's perfect, thanks! Is there also a look up table to get full player names from their shortened names, e.g. T.Brady >> Tom Brady? I know there's an id (00-0019596 for Tom Brady), perhaps it could be used for that?

ochawkeye commented 5 years ago

Players have a layer of metadata buried one level deeper by the name of .player from which you can access full player name.

import nflgame

games = nflgame.games(2018, kind='PRE', week=1, home='MIN', away='MIN')
players = nflgame.combine_max_stats(games)

for player in players:
    print player, player.team, '>', player.player.name
K.Forbath MIN > Kai Forbath
C.Keenum DEN > Case Keenum
...
A.Aruna MIN > Ade Aruna
B.Taylor MIN > Brett Taylor