nflgame icon indicating copy to clipboard operation
nflgame copied to clipboard

Depth Chart info

Open kajensen opened this issue 8 years ago • 14 comments

Looks like as of January 2014 depth chart wasn't supported (https://github.com/BurntSushi/nflgame/issues/67). Has there been any update to that? Seems to be available via this call: http://api.fantasy.nfl.com/v1/docs/service?serviceName=playersResearchInfo Thanks.

kajensen avatar Aug 09 '16 01:08 kajensen

nflgame doesn't use NFL's fantasy API and probably never will (unless it's rewritten). #67 looks unrelated.

Perhaps you could try describing the specific problem you're trying to solve?

BurntSushi avatar Aug 09 '16 01:08 BurntSushi

It would be awesome if depth chart rank was included as a player attribute. It is accessible via the non-fantasy api: https://api.nfl.com/docs/league/helpers/depthChart/index.html#depth-chart Is that feasible?

kajensen avatar Aug 11 '16 16:08 kajensen

The best place for depth chart seems to be ourlads.com.

On Thu, Aug 11, 2016 at 12:41 PM, Kurt [email protected] wrote:

It would be awesome if depth chart rank was included as a player attribute. It is accessible via the non-fantasy api: https://api.nfl.com/docs/league/helpers/depthChart/index.html#depth-chart Is that feasible?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BurntSushi/nflgame/issues/218#issuecomment-239218126, or mute the thread https://github.com/notifications/unsubscribe-auth/ACCilw7VvhOw_6vQtCHM-n1n-88ikBrOks5qe1DAgaJpZM4JfoTA .

donlaur avatar Aug 11 '16 17:08 donlaur

@donlaur any reason for that? Why would ourlads.com be more accurate/accessible than straight from nfl.com

kajensen avatar Aug 11 '16 17:08 kajensen

It generally is. NFL depth charts are usually made by the PR department. It takes into account sets and L and R for positions like WR. SWR for those with slot backs.

Sent from my iPhone

On Aug 11, 2016, at 1:16 PM, Kurt [email protected] wrote:

@donlaur any reason for that? Why would ourlads.com be more accurate/accessible than straight from nfl.com

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

donlaur avatar Aug 11 '16 17:08 donlaur

Ok thanks, completely understand why they'd be more accurate. I just figure this library would probably not want to add a dependency on a 3rd party source. Might take a look at that for personal research haha.

I haven't done a deep dive in the codebase, but to me it appears that depth chart ranks aren't easily accessible since the library parses the team roster pages that do not include depth chart info. Is that correct?

kajensen avatar Aug 11 '16 17:08 kajensen

Depth chart is available for parsing http://www.nfl.com/teams/depthchart?team=

Would this be a good addition to the library?

kajensen avatar Aug 16 '16 18:08 kajensen

The issue I see is that outside the 3rd position they are all lumped together. Certainly good to add after the preseason is over. Roster is at 90 but after week 3 game cut to 75, then after week 4 game, cut to 53. After week 4 preseason is over you could return the 1st, 2nd, 3rd and update the player info.

WR

  1. Julio Jones http://www.nfl.com/players/profile?id=JON640315
  2. Justin Hardy http://www.nfl.com/players/profile?id=HAR111877
  3. Eric Weems http://www.nfl.com/players/profile?id=WEE551877
  4. Devin Fuller http://www.nfl.com/players/profile?id=FUL189505,
  5. Jordan Leslie http://www.nfl.com/players/profile?id=LES225858,
  6. Corey Washington http://www.nfl.com/players/profile?id=WAS174012 7.

On Tue, Aug 16, 2016 at 2:49 PM, Kurt [email protected] wrote:

Depth chart is available for parsing http://www.nfl.com/teams/ depthchart?team=

Would this be a good addition to the library?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BurntSushi/nflgame/issues/218#issuecomment-240200344, or mute the thread https://github.com/notifications/unsubscribe-auth/ACCil2iLVJAhD2pTRKktEA4vDaq6-GVBks5qggZVgaJpZM4JfoTA .

donlaur avatar Aug 16 '16 19:08 donlaur

Where would you propose this sort of information reside? There does not exist a team-based position list native to nflgame so it there's not anything to add where a player exists on the depth chart to in that context.

Or is this information that you would see being added to the player profile information?

import nflgame

players = nflgame.players
for playerid, player in players.items():
    print playerid, player.name, player.number, player.years_pro, player.position
print type(player)
print dir(player)
00-0027268 Seth Williams 0 1 
...
00-0024408 Bruce Gradkowski 5 11 QB
...
00-0023461 Chris Spencer 60 11 
<class 'nflgame.player.Player'>
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'birthdate', 'college', 'first_name', 'full_name', 'gsis_id', 'gsis_name', 'height', 'last_name', 'name', 'number', 'player_id', 'playerid', 'plays', 'position', 'profile_id', 'profile_url', 'stats', 'status', 'team', 'uniform_number', 'weight', 'years_pro']

Something like player.depthchartposition included in their metadata?

I'm probably failing to see how this data might be used in conjunction with nflgame's main function as "an API to retrieve and read NFL Game Center JSON data".

Keep in mind that the metadata is a reflection of the latest scrape and that there isn't a historical record of the changes. So while you might be able to see how DAL's current 3rd string RB (Alfred Morris) fared in his most recent game, you would not be able to see how DAL's 3rd string RB fared in week 2 of 2013.

I guess the same could be said about any of the metadata already present like .college or .birthdate but keep in mind those are static. A player might rise and fall on the depth chart, but they will only ever have a single birthdate.

As a side note, nfl.com shows DAL's depth chart at RB to be Joseph Randle, Lance Dunbar, and Christine Michael. Only Dunbar is currently on the team and ourlads.com lists him as 5th on the depth chart.

ochawkeye avatar Aug 16 '16 19:08 ochawkeye

Yes, the team ones are out of date. I had just mentioned last week that they are inaccurate and ourlads is better. I am just trying to offer a suggestion to the question that was asked again. Dunbar is 5th as he is currently injured, and I believe on PUP.

On Tue, Aug 16, 2016 at 3:45 PM, ochawkeye [email protected] wrote:

Where would you propose this sort of information reside? There does not exist a team-based position list native to nflgame so it there's not anything to add where a player exists on the depth chart to in that context.

Or is this information that you would see being added to the player profile information?

import nflgame

players = nflgame.playersfor playerid, player in players.items(): print playerid, player.name, player.number, player.years_pro, player.positionprint type(player)print dir(player)

00-0027268 Seth Williams 0 1 ... 00-0024408 Bruce Gradkowski 5 11 QB ... 00-0023461 Chris Spencer 60 11 <class 'nflgame.player.Player'> ['class', 'delattr', 'dict', 'doc', 'format', 'getattribute', 'hash', 'init', 'module', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', 'birthdate', 'college', 'first_name', 'full_name', 'gsis_id', 'gsis_name', 'height', 'last_name', 'name', 'number', 'player_id', 'playerid', 'plays', 'position', 'profile_id', 'profile_url', 'stats', 'status', 'team', 'uniform_number', 'weight', 'years_pro']

Something like player.depthchartposition included in their metadata?

I'm probably failing to see how this data might be used in conjunction with nflgame's main function as "an API to retrieve and read NFL Game Center JSON data".

Keep in mind that the metadata is a reflection of the latest scrape and that there isn't a historical record of the changes. So while you might be able to see how DAL's current 3rd string RB (Alfred Morris) fared in his most recent game, you would not be able to see how DAL's 3rd string RB fared in week 2 of 2013.

I guess the same could be said about any of the metadata already present like .college or .birthdate but keep in mind those are static. A player might rise and fall on the depth chart, but they will only ever have a single birthdate.

As a side note, nfl.com http://www.nfl.com/teams/depthchart?team=DAL shows DAL's depth chart at RB to be Joseph Randle, Lance Dunbar, and Christine Michael. Only Dunbar is currently on the team and ourlads.com http://www.ourlads.com/nfldepthcharts/depthchart/DAL lists him as 5th on the depth chart.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BurntSushi/nflgame/issues/218#issuecomment-240215593, or mute the thread https://github.com/notifications/unsubscribe-auth/ACCilwy60CTWx6OSCX311540nwpKqhLLks5qghNTgaJpZM4JfoTA .

donlaur avatar Aug 16 '16 19:08 donlaur

Yes, the team ones are out of date. I had just mentioned last week that they are inaccurate and ourlads is better.

Yep, I followed that. My side note was in response to @kajensen comment that nfl.com's team depth charts were available for parsing.

I am just trying to offer a suggestion to the question that was asked again.

I'm still unclear on how you would envision retrieving this depth chart information from nflgame. Your list shows ATL's top seven WRs. So a function could exist within nflgame that you pass a team and a position argument to and it returns a list of today's depth chart? There just aren't any other comparable functions within the scope of nflgame. I'm not rejecting the idea (as if I even have a vote :stuck_out_tongue_closed_eyes:), just trying to understand how you see it being implemented.

ochawkeye avatar Aug 16 '16 20:08 ochawkeye

I don't know. Good to see how many second and third string guys get good stats. I don't want to be off topic, but do we have access to receiving targets, and snap counts? I found it in the NFL data in PDF format.

donlaur avatar Aug 16 '16 21:08 donlaur

Good to see how many second and third string guys get good stats.

But there wouldn't be a way to do that over any time period other than the most recent.

Let me explain. Every data point in nflgame today can be obtained easily from the web. nflgame itself does not keep a historical record of every game other than keeping a copy of the .json file that feeds the gamecenter page. ie. the Bills played the Titans in week 0 of the 2009 preseason. The record of that game is still freely available here and the .json file that fed that game could be easily downloaded (though for convenience and to save every user of nflgame from having to download all 1700+ games from 2009 to present it is already stored in nflgame in /nflgame/gamecenter-json/2009080950.json.gz)

nflgame didn't need to capture those games as they happened to have the data; the data is still present online today.

For the depth chart rank data you are talking about to have any meaning, one would need to know what the depth chart looked like during any given week. A 3rd string RB today could easily have been a 1st string RB a few years ago. Viewing his stats as a 3rd stringer for a game that he started and got the bulk of the carries in would not be an accurate portrayal of his performance against other 3rd stringers.

Unfortunately, unless there is some other source of the data that hasn't yet been presented here, there just isn't a place to find who made up the depth chart for the Bills/Titans game in 2009.

but do we have access to receiving targets...

Yes. .receiving_tar

import nflgame

games = nflgame.games(year=2016, week=1, kind='PRE')
players = nflgame.combine_max_stats(games)
for player in players.sort('receiving_tar').limit(5):
    print player, player.receiving_tar
J.Shipley 10
D.Waller 8
C.Latimer 8
N.Spruce 8
P.Turner 7

...and snap counts

Nope.

ochawkeye avatar Aug 16 '16 23:08 ochawkeye

Snap counts are here. But. Seem to be compiled afterwards and posted as PDF data. Could be very useful, especially for receivers. I don't know if this data lives anywhere else, in statistical format. I doubt it.

http://www.nflgsis.com/2016/PRE/02/56852/Gamebook.pdf

Just change the URL after PRE/02/ and make the integer go down. The 02 is because this is preseason week 2 because of that HOF game. Even though it wasn't played.

Sent from my iPhone

On Aug 16, 2016, at 7:38 PM, ochawkeye [email protected] wrote:

Good to see how many second and third string guys get good stats.

But there wouldn't be a way to do that over any time period other than the most recent.

Let me explain. Every data point in nflgame today can be obtained easily from the web. nflgame itself does not keep a historical record of every game other than keeping a copy of the .json file that feeds the gamecenter page. ie. the Bills played the Titans in week 0 of the 2009 preseason. The record of that game is still freely available here and the .json file that fed that game could be easily downloaded (though for convenience and to save every user of nflgame from having to download all 1700+ games from 2009 to present it is already stored in nflgame in /nflgame/gamecenter-json/2009080950.json.gz)

nflgame didn't need to capture those games as they happened to have the data; the data is still present online today.

For the depth chart rank data you are talking about to have any meaning, one would need to know what the depth chart looked like during any given week. A 3rd string RB today could easily have been a 1st string RB a few years ago. Viewing his stats as a 3rd stringer for a game that he started and got the bulk of the carries in would not be an accurate portrayal of his performance against other 3rd stringers.

Unfortunately, unless there is some other source of the data that hasn't yet been presented here, there just isn't a place to find who made up the depth chart for the Bills/Titans game in 2009.

but do we have access to receiving targets...

Yes. .receiving_tar

import nflgame

games = nflgame.games(year=2016, week=1, kind='PRE') players = nflgame.combine_max_stats(games) for player in players.sort('receiving_tar').limit(5): print player, player.receiving_tar J.Shipley 10 D.Waller 8 C.Latimer 8 N.Spruce 8 P.Turner 7 ...and snap counts

Nope.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

donlaur avatar Aug 17 '16 01:08 donlaur