nba_api icon indicating copy to clipboard operation
nba_api copied to clipboard

Insert the actual parameter names in the documentation

Open micric opened this issue 7 years ago • 9 comments

Adding the actual variable name to the url name in the documentation of the different endpoints would facilitate the usage of the package.

micric avatar Nov 22 '18 15:11 micric

Not sure what you mean, can you provide an example?

swar avatar Nov 22 '18 16:11 swar

For example in the teamyearbyyearstats endpoint, the Parameters are named LeagueID, PerMode, SeasonType and TeamID, but in python the actual variables are called league_id, per_mode_simple, season_type_all_star and team_id. stat = teamyearbyyearstats.TeamYearByYearStats(team_id=teamID, league_id = "00", per_mode_simple="Totals", season_type_all_star="Regular Season").team_stats.get_data_frame()

micric avatar Nov 22 '18 16:11 micric

I agree. This is something that definitely needs to be added in.

swar avatar Nov 28 '18 04:11 swar

Right now, the only identifying pattern is the regex that can be cross referenced to parameters documentation. However, this one is should have been added in the original documentation because no wonder people seem to be having problems using their own parameters.

Should be a relatively easy fix in the Endpoint documentation tool. If anyone wants to take this on, feel free. Otherwise, I will get to it sometime in the coming days since I believe this should be a priority.

swar avatar Nov 28 '18 05:11 swar

Yes, I think this is important. As of now is there anyway to find out what parameter names we can pass in?

I'm getting unexpected arguments errors when I do this: playergamelog.PlayerGameLog(player_id=id, season=year, season_type=type)

I know 'player_id' is right but I'm just guessing on the others.

mchauta avatar Dec 07 '18 20:12 mchauta

Ok I found them in the files, but it would be nice to have them in the docs. Also, I don't understand why "Season" is season_all and SeasonType is "season_type_all_star"? for PlayerGameLog.py

mchauta avatar Dec 07 '18 20:12 mchauta

@mchauta The reason for multiple parameter names was to standardize the regex patterns being returned. Not all season_type variables accept the same values, and thus I had to break it out into other variables.

https://github.com/swar/nba_api/blob/master/docs/nba_api/stats/library/parameters.md Here is a better picture of all the different regex patterns being spit out for variables.

swar avatar Dec 07 '18 21:12 swar

Also with the holiday season here, I am hoping to find a good break to catch up with some of these issues and knock a few of them out. So this is still pending and will be added.

swar avatar Dec 07 '18 21:12 swar

Changes have been implemented as of v1.0.7

I made more changes to the docs to make it a bit easier to read, specifically the endpoint page.

Changes include:

  • Link to the python file at the top of the documentation page. I realize it's a bit of a hurdle to jump between the pages so having a link will make it easier to go to the code.
  • Link to the Parameter documentation bookmarked to each individual API Parameter. This is to easily view the information for that Parameter.
  • Adding Python Parameter Variable so that you know what name to use in the parameters.

Let me know your thoughts and changes you want to see. Definitely open to adding information and changing formatting if needed.

swar avatar Dec 12 '18 03:12 swar