Reputation: 541
Is there an option to create new Gist with PyGithub?
There is such API option on GitHub, however it seems to be missing in PyGithub.
Upvotes: 1
Views: 442
Reputation: 541
Use Github.get_user
followed by AuthenticatedUser.create_gist
:
gh = github.Github("auth token")
gh_auth_user = gh.get_user()
gist = gh_auth_user.create_gist(public=False, files={"myfile.txt": github.InputFileContent("my contents")}, description="my description")
Upvotes: 1