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

Requests/sec #12

Closed
xeacott opened this issue Oct 10, 2018 · 7 comments
Closed

Requests/sec #12

xeacott opened this issue Oct 10, 2018 · 7 comments
Labels
question Inquiry from community

Comments

@xeacott
Copy link

xeacott commented Oct 10, 2018

I wanted to open an issue to quickly ask a question to the developers as I am coming from nba_py. I wish to use this package in a GUI that is actually turning into a class project ... however I built the GUI previously with nba_py adhering to an MVC architecture. The model I used would pull information on the fly and store whatever data the user wished. For example, the session would start clean (or could import previous player data). Upon the latter, if a user has 12 players loaded in a session looking at say 20 different categories, I would load all the information at startup time. (Through sending requests for each player.)

I know this may present an issue as I would be asking for lots of requests from stats.nba.com and I know they have been limiting requests/sec. Do the developers have preferences or suggestions on allowing/disallowing this behavior?

edit: typos, grammer, etc.

@swar swar added the question Inquiry from community label Oct 11, 2018
@swar
Copy link
Owner

swar commented Oct 11, 2018

I'm sure people will have varying answers to this question. Personally, I wouldn't want to flood any website with many requests. I don't want to abuse something that's publicly available, but I do think there are ways around it while maintaining respect for the website. You could make sure you're pausing between requests and caching the information so that you don't have to make multiple requests for the same information.

Depending on how many requests you plan on submitting, just be mindful that they can ban your IP or even a group of IPs if they are all coming from the same location, such as a university.

@xeacott
Copy link
Author

xeacott commented Oct 11, 2018

Understood - Beyond the scope of the 'requirements' i have to fill, I will probably build around this so it doesn't become an issue. Thank you for the response.

@jaypeedevlin
Copy link

Jumping into this topic, one of the things I loved about nba_py when using it was that it used requests-cache which meant that it avoiding hitting the endpoints repeatedly when you were optimizing code etc.

I wonder if that might be an easy drop-in which would mitigate some of the cases (and be generally more respectful to the underlying API)

@xeacott
Copy link
Author

xeacott commented Oct 11, 2018

I do agree with Jay, respecting public APIs is important and hopefully that is something that can be implemented. There ought to be a package that is the gold standard...

@swar
Copy link
Owner

swar commented Oct 11, 2018

I am going to add an issue per @jaypeedevlin so that we can look into adding in requests-cache functionality as that'll be a good idea and a replacement to DEBUG_STORAGE in debug.py

@xeacott
Copy link
Author

xeacott commented Oct 11, 2018

Also, this thread may be closed at your discretion @swar

@swar
Copy link
Owner

swar commented Oct 11, 2018

@xeacott I'll leave it open until the end of the month in case anyone else has anything to add. Thank you!

@swar swar closed this as completed Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Inquiry from community
Projects
None yet
Development

No branches or pull requests

3 participants