Consider adding to the readme an example of using API modifying goal
matkoniecz opened this issue · 0 comments
matkoniecz commented
Currently it is not obvious to me how to do this using this library
I found
pyminder/pyminder/beeminder.py
Line 35 in 36a7d6f
pyminder = Pyminder(user='[your username - dummy field]', token=token())
pyminder._beeminder.update_goal("ping_babcia", title="ping_babcia_description")
works, but is using internal _
prefixed things.
And to edit arbitrary parameters following terribleness works, but I hope for something nicer.
pyminder = Pyminder(user='[your username - dummy field]', token=token())
#pyminder._beeminder.update_goal("ping_babcia", title="ping_babcia_description")
goal_name = "ping_babcia"
endpoint = f'users/{pyminder._beeminder._user}/goals/{goal_name}.json'
data = {"fineprint": "test fineprint", "title": "ping_babcia_description"}
pyminder._beeminder._call(endpoint, data=data, method="PUT")
And thanks for a publishing this library, it saved me some time that would be needed to write it on my own!