Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert the actual parameter names in the documentation #19

Closed
micric opened this issue Nov 22, 2018 · 9 comments
Closed

Insert the actual parameter names in the documentation #19

micric opened this issue Nov 22, 2018 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@micric
Copy link

micric commented Nov 22, 2018

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

@swar
Copy link
Owner

swar commented Nov 22, 2018

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

@micric
Copy link
Author

micric commented Nov 22, 2018

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()

@swar
Copy link
Owner

swar commented Nov 28, 2018

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

@swar swar added the enhancement New feature or request label Nov 28, 2018
@swar swar self-assigned this Nov 28, 2018
@swar
Copy link
Owner

swar commented Nov 28, 2018

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.

@mchauta
Copy link

mchauta commented Dec 7, 2018

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
Copy link

mchauta commented Dec 7, 2018

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

@swar
Copy link
Owner

swar commented Dec 7, 2018

@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
Copy link
Owner

swar commented Dec 7, 2018

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
Copy link
Owner

swar commented Dec 12, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants