this is my first question to stackoverflow. So be kind, if I am not on topic or precise and help me improve for the next time.
I am trying to modify and existing Github Gist through Python3 using pyGithub. I created an API-token and authentification works ok, but I am struggeling to edit the Gist. I could not find an appropriate example, that made it clear to me.
Here is my code:
from github import Github
g = Github("XXX")
test2 = {"description": "the description for this gist",
"files": {"filter": {"content": "updated file contents"},
"Task": {"filename": "new_name.txt",
"content": "modified content"},
"new_file.txt": {
"content": "a new file"
}
}
}
g.get_gist(id="b2c5668fefe1f2e80252aabf4ef4e96c").edit(test2)
This is the error message I am getting:
Traceback (most recent call last):
File "gist.py", line 15, in <module>
g.get_gist(id="b2c5668fefe1f2e80252aabf4ef4e96c").edit(test2)
File "/Users/DSpreitz/ogn-silentwings/venv/lib/python3.6/site-packages/github/Gist.py", line 249, in edit
assert description is github.GithubObject.NotSet or isinstance(description, str), description
AssertionError: {'description': 'the description for this gist', 'files': {'filter': {'content': 'updated file contents'}}}
I found some description of the pygithub lib here: pyGithub Docu
This is the Gist I am trying to modify: Gist
Any help to solve this problem is greatly appreciated.
Dominic