Skip to content

Consider adding to the readme an example of using API modifying goal #4

@matkoniecz

Description

@matkoniecz

Currently it is not obvious to me how to do this using this library

I found

def update_goal(self, goal_name, slug=None, title=None, yaxis=None, secret=None,
that allows to do this with some subset of parameters.

    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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions