Giter VIP home page Giter VIP logo

nba_py's Introduction

PyPI Travis License Documentation Status Join the chat at https://gitter.im/seemethere/nba_py

NOTE: This repository is no longer maintained, feel free to fork.

nba_py - stats.nba.com API for python

Stable version: v0.1a1

This branches version: v0.1a2

Summary

A python facing API for stats.nba.com (Still in heavy development)

Originally based off https://github.com/bradleyfay/NBAStats

Installation

NOTE: Developmental builds, are by no means stable If you want the stable version use:

$ pip install nba_py

Else:

  • Download from source (git clone, zipped package)
  • Run from the root directory:
$ pip install .

Requirements Requires.io

Nice to have

Pandas is nice to have because it'll put the data in an easy to manage object, but it is by no means necessary. All data, if pandas is not installed is returned in a nice json list format with headers!

Requests-cache is nice to have when you are downloading very large datasets so that subsequent downloads take much less time, but again, it is by no means necessary.

Completed work

Planned development

1. Documentation

  • All around documentation not only of nba_py but also stats.nba.com (it's pretty nonexistent)

2. Map rest of API (Completed)

nba_py's People

Contributors

huyqle3 avatar insightpeter avatar lentils avatar marek5050 avatar mcdallas avatar mwilliammyers avatar proche90210 avatar rgreasons avatar rymc9384 avatar seemethere avatar spancypantz avatar spudfkc avatar swar avatar trevormccormick avatar vitamintk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nba_py's Issues

Showing Matchups!

Hello man, i just found your documentation about nba stats, really good stuff, because all ive found it was like payed api. Im practicing some coding on Ruby, just trying to display daily matchups, For example, i wanna show today games, ill use "stats.nba.com/stats/scoreboard/?GameDate=09/01/2016&LeagueID=00&DayOffset=0",is that correct? or i have to use other endpoint? i can find each team on each conference, but i dont get it to get the daily games. Sorry about my grammar, English isnt my first language :).

Short problem: I just want to find the daily games, ex : Chicago vs Atlanta

Thanks!

Improve tests to be done per endpoint and not all at once

Overview:

Tests should be done per endpoint and not all at once to stop one test failing all the tests

How:

Utilize pytests fixture to iterate through the objects and then iterate through the functions in the objects to make sure each of them do not raise an exception

Scoreboard access

Sorry, I know this is a simple request, but I can't seem to figure it out. To access a specific game ID I need to use the Scoreboard endpoint. What terms do I use to access scoreboard? I've tried:

newgame = game.Scoreboard()
... etc.
I know the "game" part is wrong, but I'm not sure what to replace it with.

Get Team Pace Stats

Hey, I know your working on the new endpoints and documentation, but do you know how to get a team's pace stats or the player's pace stats? Looks like the endpoint url for the teams I want is:

http://stats.nba.com/stats/leaguedashteamstats?Conference=&DateFrom=&DateTo=&Division=&GameScope=&GameSegment=&LastNGames=0&LeagueID=00&Location=&MeasureType=Advanced&Month=0&OpponentTeamID=0&Outcome=&PORound=0&PaceAdjust=N&PerMode=Totals&Period=0&PlayerExperience=&PlayerPosition=&PlusMinus=N&Rank=N&Season=2016-17&SeasonSegment=&SeasonType=Regular+Season&ShotClockRange=&StarterBench=&TeamID=0&VsConference=&VsDivision=

for the individual players it is:

http://stats.nba.com/stats/leaguedashplayerstats?College=&Conference=&Country=&DateFrom=&DateTo=&Division=&DraftPick=&DraftYear=&GameScope=&GameSegment=&Height=&LastNGames=0&LeagueID=00&Location=&MeasureType=Advanced&Month=0&OpponentTeamID=0&Outcome=&PORound=0&PaceAdjust=N&PerMode=Totals&Period=0&PlayerExperience=&PlayerPosition=&PlusMinus=N&Rank=N&Season=2016-17&SeasonSegment=&SeasonType=Regular+Season&ShotClockRange=&StarterBench=&TeamID=0&VsConference=&VsDivision=&Weight=

But I am not sure which functions to use in your program to get to those spots. Do you happen to know?

Thanks!

Games endpoint not working

When I run the example_game.py file I get a 404. It was working last week so maybe the NBA changed their endpoint?

Traceback (most recent call last):
File "example_game.py", line 7, in
box = game.Boxscore('0041400122')
File "/Library/Python/2.7/site-packages/nba_py/game.py", line 21, in init
'EndRange': end_range})
File "/Library/Python/2.7/site-packages/nba_py/init.py", line 74, in _get_json
_get.raise_for_status()
File "/Library/Python/2.7/site-packages/requests/models.py", line 844, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://stats.nba.com/stats/boxscore?GameID=0041400122&RangeType=0&StartPeriod=0&StartRange=0&EndPeriod=0&EndRange=0

Shot chart API not working

Think it's a problem with NBA stats API?

shot_chart_url = 'http://stats.nba.com/stats/shotchartdetail?Period=0&VsConference=&LeagueID=00&LastNGames=0&TeamID=0&Position=&Location=&Outcome=&ContextMeasure=FGA&DateFrom=&StartPeriod=&DateTo=&OpponentTeamID=0&ContextFilter=&RangeType=&Season=2015-16&AheadBehind=&PlayerID=201939&EndRange=&VsDivision=&PointDiff=&RookieYear=&GameSegment=&Month=0&ClutchTime=&StartRange=&EndPeriod=&SeasonType=Regular+Season&SeasonSegment=&GameID='
response = requests.get(shot_chart_url)
headers = response.json()['resultSets'][0]['headers']

ValueError Traceback (most recent call last)
in ()
6 shot_chart_url = 'http://stats.nba.com/stats/shotchartdetail?Period=0&VsConference=&LeagueID=00&LastNGames=0&TeamID=0&Position=&Location=&Outcome=&ContextMeasure=FGA&DateFrom=&StartPeriod=&DateTo=&OpponentTeamID=0&ContextFilter=&RangeType=&Season=2015-16&AheadBehind=&PlayerID=201939&EndRange=&VsDivision=&PointDiff=&RookieYear=&GameSegment=&Month=0&ClutchTime=&StartRange=&EndPeriod=&SeasonType=Regular+Season&SeasonSegment=&GameID='
7 response = requests.get(shot_chart_url)
----> 8 headers = response.json()['resultSets'][0]['headers']
9
10 print shot_chart_url

/Users/crawles/anaconda/lib/python2.7/site-packages/requests/models.pyc in json(self, **kwargs)
824 # used.
825 pass
--> 826 return complexjson.loads(self.text, **kwargs)
827
828 @Property

/Users/crawles/anaconda/lib/python2.7/json/init.pyc in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
337 parse_int is None and parse_float is None and
338 parse_constant is None and object_pairs_hook is None and not kw):
--> 339 return _default_decoder.decode(s)
340 if cls is None:
341 cls = JSONDecoder

/Users/crawles/anaconda/lib/python2.7/json/decoder.pyc in decode(self, s, _w)
362
363 """
--> 364 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
365 end = _w(s, end).end()
366 if end != len(s):

/Users/crawles/anaconda/lib/python2.7/json/decoder.pyc in raw_decode(self, s, idx)
380 obj, end = self.scan_once(s, idx)
381 except StopIteration:
--> 382 raise ValueError("No JSON object could be decoded")
383 return obj, end

ValueError: No JSON object could be decoded

Functions marked as "FORBIDDEN BY THE NBA" seems to work

I am able to successfully retrieve data from the following functions that were commented as "FORBIDDEN BY THE NBA":

PlayerGeneralSplits
PlayerOpponentSplits
PlayerShootingSplits

I simply call the function with a player ID like following:

stats_a = player.PlayerShootingSplits(player_id='203507')
print((stats_a.shot_5ft())

Trying to install module on Cloud9 IDE

Hey, I'm sort of a coding noob but I'm trying to figure out how to use your API on Cloud9's cloud-based IDE and I'm running into some problems. Specifically, when I try to install the package using

$ pip install .

I receive the following error:
...
running install_lib
creating /usr/local/lib/python2.7/dist-packages/nba_py
error: could not create '/usr/local/lib/python2.7/dist-packages/nba_py': Permission denied

Any ideas on what I could do to fix this? I'm pretty sure it's somehow related to the fact that I'm running this on a cloud-based server and not off of my hard drive. Thanks!

test returns 400 error

Hey man, really appreciate your work, trying to run the best
bs = game.Boxscore('0041400122')
print bs.game_summary()

keeps on returning 400 error, i imported game from nba_py, any idea?

HTTPError Traceback (most recent call last)
in ()
----> 1 bs = game.Boxscore('0041400122')
2 print bs.game_summary()

C:\Anaconda2\lib\site-packages\nba_py\game.pyc in init(self, game_id, range_type, start_period, end_period, start_range, end_range)
19 'EndPeriod': end_period,
20 'StartRange': start_range,
---> 21 'EndRange': end_range})
22
23 def game_summary(self):

C:\Anaconda2\lib\site-packages\nba_py__init__.pyc in _get_json(endpoint, params)
40 _get = get(BASE_URL.format(endpoint=endpoint), params=params)
41 # print _get.url
---> 42 _get.raise_for_status()
43 return _get.json()
44

C:\Anaconda2\lib\site-packages\requests\models.pyc in raise_for_status(self)
838
839 if http_error_msg:
--> 840 raise HTTPError(http_error_msg, response=self)
841
842 def close(self):

HTTPError: 400 Client Error: Bad Request for url: http://stats.nba.com/stats/boxscore/?GameID=0041400122&RangeType=0&StartPeriod=0&StartRange=0&EndPeriod=0&EndRange=0

player.get_player() marginalizes Nene

player.get_player() takes the required arguments: "first_name" and "last_name". Nene, the unique flower that he is, only has one name, so the string formatting in this function will not work for him.

A fix would be to make the last_name argument optional, and perform string formatting differently for those with both names and those with only a first name. Hopefully there's no NBA player with 3 names.

Add in better, more up to date, examples

Overview

The included examples are out of date and not useful anymore we need to add examples for:

  • Using the base functionality with pandas
  • Using the base functionality with pandas
  • Base example with how to access player stats
  • Base example with how to access game stats

figuring out players on the floor for any point in play-by-play

Thanks for the in-depth documentation. I've been reading about how the API is slowly being scaled back. I would like to know if, using what currently exists, you can figure out who was on the floor for every line in the play-by-play. Using the boxscoretraditionalv2 endpoint I was able to find out all the starters and tie that to the plays I got from playbyplayv2. I thought it would be as easy as writing a script that would change players for every "SUB:" line, given the starting lineup. But what I failed to realize is that substitutions that happen between quarters are not documented in play-by-play. So I guess a simpler version of what I'm asking is, can you figure out from any of these API endpoints who started each quarter? That would help towards accomplishing my goal as well.

Other literature I've read online suggested tying the data from the locations_getmoments endpoint to do this, but I don't think that is possible anymore.

Many thanks for the great service and any help you can provide.

Getting all players' current season advanced stats

New to using the API, but I was trying to get every current player's advanced stats for the current season. Here's my code:

from nba_py import player
players = player.PlayerList(season='2016-17')
data = []
for index, row in players.info().iterrows():
    curr_player = player.PlayerGeneralSplits(row['PERSON_ID'], measure_type='Advanced')
    curr_player_ovr = curr_player.overall()
    data.insert(index, curr_player_ovr)
print data

This is taking a while. Maybe there's a faster way to add the results to an array (I want to eventually output it all to a JSON file). I'm somewhat new to python. Is it my code that's causing this to take a while (probably around ten minutes), or is it just because the API has to go scrape all of the data.

Thanks for making this API by the way!

data.nba.com endpoint with more location information for play by play

It looks like aside from stats.nba.com there is also data.nba.com. Does anyone know anything about this endpoint? It looks like the current stats.nba.com website is pulling play-by-play data from here:

http://data.nba.com/data/10s/v2015/json/mobile_teams/nba/2016/scores/pbp/0021600361_full_pbp.json

It seems similar to current play by play endpoint but in addition it also contains x,y locations of fouls (rebounds seem to be the same value all the time). Does anyone know more about this endpoint. Should we add this endpoint to enable the extra x,y information? Please let me know if this just duplicate of something that is already available with the current API.

Endpoints

How did you checked what endpoints exists? I can't believe there is no way to get general splits for a player (The original function is blocked :-()

Player's PER

Hi,

I've been looking for some time, but with no luck - does anybody know how to get player's PER from the API?

Thanks in advance,
Paweł

All players not present?

Hello,

I'm trying to do a simple pull. Looking at a histogram of all player's points totals from past seasons. However, if I try to pull all player ID's from a past season:

pid_list = player.PlayerList(league_id=League.NBA,season='2010-11').info()['PERSON_ID']

For 2010-11, for instance, I only get a list of ~70 players. Shouldn't there be more like 400?

Requires recent version of requests

Just in case anyone else comes across this, I was getting nothing but "400 Bad Request" errors. I eventually tracked it down to the fact I was running an old version of requests (2.8.1).. Upgrading to 2.10.0 fixed my issue.

How to get game id?

How do you retrieve the game id for a particular game to supply to playbyplay and other functions?

couldn't get player.py calls to work

sorry, was being stupid

but does anyone have old files from the closed off end points such as
playerdashptreboundlogs

just wondering what it looks like. Thanks!

Slow response when running code

I'm new to Python so not sure if I'm doing something wrong, but it takes more than two minutes to get any response when running this code:

from nba_py import game
box = game.Boxscore('0041400122')

It that normal? I've tried multiple IDEs with the same code with the same results. My internet is not slow (I have Webpass) either.

When I try the following in my browser it loads quickly (less than 1 sec):

http://stats.nba.com/stats/boxscoretraditionalv2?StartRange=0&GameID=0041400122&EndPeriod=0&RangeType=0&Season=2016-17&StartPeriod=0&SeasonType=Regular+Season&EndRange=0

Are there any settings I can check?

Curious where the endpoint docs game from?

This is fantastic https://github.com/seemethere/nba_py/wiki/stats.nba.com-Endpoint-Documentation

I'm developing an equivalent node package https://github.com/nickb1080/nba and I'm curious how you found the acceptable parameters for each endpoint. Given the highly dynamic nature of both Python and JavaScript, it would be a cool idea to put these endpoint docs in a simple machine-readable format (JSON?) and generate the API client and some documentation from it programmatically. This would really lower the barrier to developing NBA API clients in other languages, as well as decrease the ongoing cost of providing documentation. I may take a stab at that sometime soon, do you have any interest in taking a similar approach for this package? Thanks for the hard work!

Could not open game details

Hi, I could not get your game example to work.
The following commands result in an error:

from nba_py import game
bs = game.Boxscore('0041400122')
print bs.game_summary()

Could you please tell me why it is not working?
Thanks,
Gabriel.

Can't install via pip

Hey, I'm having trouble installing on pip with python 3.3 on mac. Any ideas? Not sure what the requirements should be. Pasted my terminal output and the full log below.

Cheers.

pip install nba_py
Downloading/unpacking nba-py
Could not find a version that satisfies the requirement nba-py (from versions: 0.1a1, 0.1a1.win-amd64, 0.1a1)
Cleaning up...
No distributions matching the version for nba-py
Storing debug log for failure in /Users/riaan/Library/Logs/pip.log


/usr/local/bin/pip3 run on Tue Jan 5 22:06:03 2016
Downloading/unpacking nba-py

Getting page https://pypi.python.org/simple/nba-py/
URLs to search for versions for nba-py:

Cleaning up...

Removing temporary dir /private/var/folders/_v/hs6gcbb12n3187qjjmylqzgh0000gp/T/pip_build_riaan...
No distributions matching the version for nba-py

Exception information:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.3.3/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pip-1.4.1-py3.3.egg/pip/basecommand.py", line 134, in main
status = self.run(options, args)
File "/usr/local/Cellar/python3/3.3.3/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pip-1.4.1-py3.3.egg/pip/commands/install.py", line 236, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/local/Cellar/python3/3.3.3/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pip-1.4.1-py3.3.egg/pip/req.py", line 1085, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/local/Cellar/python3/3.3.3/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pip-1.4.1-py3.3.egg/pip/index.py", line 309, in find_requirement
raise DistributionNotFound('No distributions matching the version for %s' % req)
pip.exceptions.DistributionNotFound: No distributions matching the version for nba-py

wiki endpoint documentation outdated?

The wiki has "boxscore" and "boxscoreadvanced" listed, but these don't seem to be available from what I can see? Do these no longer exist? Should those sections be removed from the wiki?

Errors running example_game

Noob here, quick question. Just downloaded repo and followed setup instructions (also ran setup.py build and setup.py install) and ran game_example.py to check it out. I'm able to successfully print out data from game.PlayByPlay, game.Boxscore, game.BoxscoreSummary, and game.PlayerTracking. However when I try to print data from game.BoxscoreScoring, game.BoxscoreUsage, game.BoxscoreMisc, game.BoxscoreAdvanced, or game.BoxscoreFourFactors I get a list index out of range error.

Seemingly it's only the functions with the "sql" prefix that won't work. Did I miss something in the setup? Sorry if there's an obvious answer here. Anyways, love what you are developing here. Thanks!

playerdashptshotlog is broken

Not sure if NBA changed the API or not, but the shot logs, probably the most cool data endpoint doesn't exist any more. How did you define the endpoint space in the first place? maybe they changed the url?

live data?

Is this data updated real-time, during a game? or is it updated in bulk offline?

Getting errors

Below are the errors I am getting from the tests folder:

from nba_py import player
from nba_py.player import get_player
def test():
pid = get_player('Tim', 'Duncan')
vs_pid = get_player('Stephen', 'Curry')
assert player.PlayerList()
assert player.PlayerSummary(pid)
assert player.PlayerGeneralSplits(pid)
assert player.PlayerOpponentSplits(pid)
assert player.PlayerLastNGamesSplits(pid)
assert player.PlayerInGameSplits(pid)
assert player.PlayerClutchSplits(pid)
assert player.PlayerShootingSplits(pid)
assert player.PlayerPerformanceSplits(pid)
assert player.PlayerYearOverYearSplits(pid)
assert player.PlayerCareer(pid)
assert player.PlayerProfile(pid)
assert player.PlayerGameLogs(pid)
assert player.PlayerShotTracking(pid)
assert player.PlayerReboundTracking(pid)
assert player.PlayerPassTracking(pid)
assert player.PlayerDefenseTracking(pid)
assert player.PlayerShotLogTracking(pid)
assert player.PlayerReboundLogTracking(pid)
assert player.PlayerVsPlayer(pid, vs_pid)

test()


Traceback (most recent call last):
File "C:/Users/Troy/PycharmProjects/nbastats/nbaStatsLebron.py", line 29, in
test()
File "C:/Users/Troy/PycharmProjects/nbastats/nbaStatsLebron.py", line 6, in test
pid = get_player('Tim', 'Duncan')
File "C:\Users\Troy\AppData\Local\Programs\Python\Python35-32\lib\site-packages\nba_py\player.py", line 11, in get_player
pl = PlayerList(season=season, only_current=only_current).info()
File "C:\Users\Troy\AppData\Local\Programs\Python\Python35-32\lib\site-packages\nba_py\player.py", line 28, in init
'IsOnlyCurrentSeason': only_current})
File "C:\Users\Troy\AppData\Local\Programs\Python\Python35-32\lib\site-packages\nba_py__init__.py", line 42, in _get_json
_get.raise_for_status()
File "C:\Users\Troy\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\models.py", line 840, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://stats.nba.com/stats/commonallplayers/?LeagueID=00&IsOnlyCurrentSeason=0&Season=2014-15

Is there something that I need to setup in order for this to work?

thoughts on client generation from structured data?

Hi, I'm the developer of a similar package for Node.js. I combined the endpoints and parameter values used here with ones I found on my own poking around nba.com into some structured data that can be used to generate an API client programmatically. I've put that data here and will be updating my client to use it shortly. I'm curious if you're interested in using that data in this project at all. If there's a single source of truth for what endpoints the NBA currently supports and what parameters they accept it makes everyone's life easier.

404 on PlayerShotLog

It seems that most of the player.py endpoints are functioning however I am getting a 404 on the PlayerShotLogTracking. This same input works for PlayeerShootingSplits.

from nba_py import player

Aaron_brooks = player.get_player(first_name="Aaron",last_name="Brooks")

shot_log = player.PlayerShotLogTracking(player_id=Aaron_brooks)


HTTPError Traceback (most recent call last)
in ()
1 #Broken
----> 2 shot_log = player.PlayerShotLogTracking(player_id=Aaron_brooks)

/Users/befeltingu/anaconda/lib/python2.7/site-packages/nba_py/player.pyc in init(self, player_id, team_id, measure_type, per_mode, plus_minus, pace_adjust, rank, league_id, season, season_type, po_round, outcome, location, month, season_segment, date_from, date_to, opponent_team_id, vs_conference, vs_division, game_segment, period, shot_clock_range, last_n_games)
180 'ShotClockRange': shot_clock_range,
181 'LastNGames': last_n_games},
--> 182 referer='player')
183
184 def overall(self):

/Users/befeltingu/anaconda/lib/python2.7/site-packages/nba_py/init.pyc in _get_json(endpoint, params, referer)
83 headers=h)
84 # print _get.url
---> 85 _get.raise_for_status()
86 return _get.json()
87

/Users/befeltingu/anaconda/lib/python2.7/site-packages/requests/models.pyc in raise_for_status(self)
842
843 if http_error_msg:
--> 844 raise HTTPError(http_error_msg, response=self)
845
846 def close(self):

HTTPError: 404 Client Error: Not Found for url: http://stats.nba.com/stats/playerdashptshotlog?PlusMinus=N&PlayerID=201566&TeamID=0&Location=&ShotClockRange=&SeasonType=Regular+Season&Season=2015-16&PaceAdjust=N&DateFrom=&VsConference=&OpponentTeamID=0&DateTo=&GameSegment=&LastNGames=0&VsDivision=&LeagueID=00&Outcome=&MeasureType=Base&PORound=0&PerMode=PerGame&SeasonSegment=&Period=0&Rank=N&Month=0

It looked as though the only required argument to pass to PlayerShotLogTracking was the player_id. So perhaps they have changed the endpoint?

Pulling Future games for players

Is there a simple way to pull the schedule for future games, for a given player? I'm interested in simulating future performance for a week, and need to know how many times each player will play.

Make nba_py PEP8 compliant

Overview

nba_py currently has a lot of PEP8 violations and eventually we should add flake8 to the gate job so that we can adhere to PEP8 standards

How

  • An autolinter like autopep8 can be used but could potentially break things
  • Can be done manually

Time of Foul and player in Game Log

Hello,

Is there a method to see the time in the game a foul has been committed and the player who committed the foul? I've been searching for over an hour and haven't seen one. If not, is this some functionality you can add?

Incorrect user-agent?

import requests
from nba_py import player, team
from nba_py.constants import *
from __future__ import print_function

bulls = team.TeamCommonRoster(team_id=TEAMS['CHI']['id'], 
                              season=CURRENT_SEASON)

I'm getting a 400 Client Error: Bad Request for url when I run this. However, if I navigate to the link manually: http://stats.nba.com/stats/commonteamroster/?TeamID=1610612741&Season=2015-16 , and then run the snippet, it works. So if it is able to access the data from the cache, there must be an issue with the user-agent replicating the browser.

Advanced Stats

Hey, is there any way to access the stats found here?

If not, I'll have to go parse the HTML at basketball reference :/

[Noob Question] How Can I Fix This ?

Hi. I am completly noob at Python and this module. I tried like this but it failed. How can I fix ?

from nba_py import team
A=team.TeamLineups(1610612765)
print(A)

result:
nba_py.team.TeamLineups object at 0x00000089FE5227F0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.