pynder
pynder copied to clipboard
Q: Selective Downloading of Data Subsets
Is it possible to download only a subset or portion of the data? For example, the data only for:
-
one matched user :
session.matches(i)
-
only the ping_time data – for one user or all users :
session.matches(i).user.ping_time
orsession.matches().ping_time
-
only the messages – for one user or all users :
session.matches(i).messages
orsession.matches().messages
instead of downloading the whole dataset of all users? : session.matches()
Given that the tinder app does not download all the data every time, and the tinder API does not seem to require downloading all the data, is it possible to download only a small subset?
Thank you!
I also agree that this would be useful. I'm currently running into an issue where session.matches()
is timing out with a 504 error because I have too many matches (would be my guess).
:+1: This is a good idea.
I have 1300 total matches. Here is the output:
matches = session.matches()
File "/Library/Python/2.7/site-packages/pynder-0.0.10-py2.7.egg/pynder/session.py", line 32, in matches
return [models.Match(m, self) for m in self._api.matches()]
File "/Library/Python/2.7/site-packages/pynder-0.0.10-py2.7.egg/pynder/models/user.py", line 126, in __init__
match['person']['_id'])['results']
File "/Library/Python/2.7/site-packages/pynder-0.0.10-py2.7.egg/pynder/api.py", line 84, in user_info
return self._get("/user/" + user_id)
File "/Library/Python/2.7/site-packages/pynder-0.0.10-py2.7.egg/pynder/api.py", line 47, in _get
return self._request("get", url)
File "/Library/Python/2.7/site-packages/pynder-0.0.10-py2.7.egg/pynder/api.py", line 43, in _request
raise errors.RequestError(result.status_code)
pynder.errors.RequestError: 504
Or could it be that the request times out... due to any proxy servers in between which time out?
I'd say that is the more likely case.
I think we can fix this by caching + lazyloading user data
The ability to download only a subset or portion of the data would make @rdrapeau's issue a non-issue. Plus, that will enable even more features and abilities for Pynder. Thoughts?
I don't have time right now, but perhaps in the future, or if somebody else wants to open a PR they're more than welcome.
See also #72 and #70
@SHABINTHEGREAT, @charliewolf
This is a very good idea, Shabin. As a some sort of workaround to manipulate matches data I load session._api.matches() instead of loading session.matches() because the latter takes ages to load +200 matches whereas the former loads pretty fast. But the one problem I have found is that I haven't figured it out how to send a message to a match using the data downloaded from session._api.matches().