Add method UserHistory#174
Conversation
…s for a user Another ways: * Web UI: https://www.openstreetmap.org/user/Alexey%20Vazhnov/history * Manual API request: https://api.openstreetmap.org/api/0.6/changesets?display_name=Alexey%20Vazhnov Possible improvements: * add possibility to use `user=#uid` as alternative to current `display_name=UserId` * URL encoding for `UserId`, for example replace ` ` with %20 * if keep using `return`, maybe use `OrderedDict` to save the order of records * use `yield` (but then resulting structure will be different)
The default date is 2005-01-01 because of https://www.openstreetmap.org/changeset/1 which is 2005-04-09, so probably there are no changes earlier in the OSM DB.
… is good for experiments
|
@metaodi , thank you for the clue! I've checked What do you think, should I try to improve Sorry for not responding quickly, it was pretty busy year. |
|
@metaodi ? |
|
@vazhnov This library should be a thin wrapper, so I don't want to add a lot of extra methods for API functions that are a ready covered. But I'm open to enhance the existing |
|
PR in #188 |
Add method
UserHistory(UserId)which returns all changesets for a user.Usage example:
Other ways to fetch all changesets for a user:
Closes https://help.openstreetmap.org/questions/23089/ 😄
How to test the code from the branch:
Questions:
user_historyinstead ofUserHistory? Create a more "pythonic" API #39Should I add to the docstring, that limits/defaults,changesets maximum_elementsandchangesets default_query_limitcan be received bycapabilities()method from GET /api/capabilities?Should I remove.time.sleepfrom the code? I use it to reduce a peak load to the API server, but probably it is a premature optimizationP.S.: I'm not a Python developer. Maybe my code is ugly and wrong — please write a comment or edit the code.