Questions tagged [pygithub]

PyGitHub is a Python library implementing the GitHub REST API v3, to manage GitHub resources (repositories, user profiles, organizations, etc.) from Python scripts.

PyGitHub is a Python library implementing the GitHub API v3, to manage GitHub resources (repositories, user profiles, organizations, etc.) from Python scripts.

See also

210 questions
17
votes
7 answers

How do I push new files to GitHub?

I created a new repository on github.com and then cloned it to my local machine with git clone https://github.com/usrname/mathematics.git I added 3 new files under the folder mathematics $ tree . ├── LICENSE ├── numerical_analysis │   └──…
SparkAndShine
  • 17,001
  • 22
  • 90
  • 134
13
votes
4 answers

Get github username through primary email

I'm using the PyGithub library to invite new member to the organization. The issue I faced is the next: In the scenario, when I know only users primary email, how can I retrieve his username to proceed invite accordingly? I know it is possible…
million_miles
  • 199
  • 1
  • 2
  • 10
12
votes
1 answer

Create, Clone, and Push to GitHub repo using PyGitHub and PyGit2

How can I create a new GitHub repository, clone it, change files, and then push it back to github using python and the pyGitHub and pyGit2 libraries? The documentation for both libraries is very sparse and there are almost no examples.
Bar Smith
  • 797
  • 6
  • 20
9
votes
1 answer

How to checkout to a new branch with Pygithub?

This is what I have learned, g = Github("user", "pass") repoName = "apiTest" print "Get all repos:" for repo in g.get_user().get_repos(): print "\t%s" % repo.name print "<--------------------------------------------------->" print "Get all…
ypeng
  • 151
  • 1
  • 8
9
votes
2 answers

How to update a file using PyGithub?

I want to know which method should I call (and on which object) and how to call that method (required parameters and their meanings).
Abhishek Kumar
  • 298
  • 4
  • 10
9
votes
3 answers

Is there possibility to get releases with pyGithub

I havent used PyGithub yet but I am just curious if there is any possibility to get a list of releases from a repository (e.g. https://github.com/{username}/{repo-name}/releases). I can not see any information about that in documentation here.
widget
  • 421
  • 1
  • 5
  • 17
8
votes
5 answers

Login problems using pygithub

We are trying to log into our GitHub server using pygithub as follows below. Note that 'token_bla_bla' is the token that we have generated in GitHub for that user: g = Github(login_or_token='token_bla_bla', base_url='https://github.company.com') We…
gio
  • 81
  • 1
  • 2
7
votes
1 answer

Github API generated annotated tag not showing up in git describe

I am trying to write a script to automatically setup github releases using a custom CI trigger. I have a python script that uses pygithub to automatically create a tag and a release. # roughly the following…
Tareq A. Siraj
  • 424
  • 3
  • 9
7
votes
2 answers

Receiving Github APi 403 error when I have not exceeded my rate limit

I'm scraping data off of Github via PyGithub. My issue is I receive this error during my scraping: github.GithubException.GithubException: 403 {'documentation_url': 'https://developer.github.com/v3/#rate-limiting', 'message': 'API rate limit…
ChillMurray
  • 81
  • 1
  • 5
6
votes
1 answer

PyGithub - How to get a list of all commits for a particular branch?

I need to check all commits made to a particular branch on github. I am aware of repo.get_commits() but this returns commits for all branches of that repository I guess. I haven't found any branch attribute neither in Commit class nor in…
Emil Haas
  • 484
  • 3
  • 17
6
votes
1 answer

How to authorize ssh key in Github via their API

My Github org requires SAML SSO authentication for all members, which requires new ssh keys added to an account to be authorized (https://help.github.com/en/github/authenticating-to-github/authorizing-an-ssh-key-for-use-with-saml-single-sign-on).…
bgrande
  • 119
  • 1
  • 1
  • 4
6
votes
3 answers

Issue with JWT token authentication in PyGithub

I want to create a github app in python, and I'm stuck at the authentication part. Since they don't support python by default, I have to use a third party library. After I generate the JWT token I can successfully authenticate with curl, but not…
ilo
  • 316
  • 2
  • 12
6
votes
1 answer

How to close an issue with GitHub API

I am trying to figure out how to close an issue through the Github API. Specifically I'm trying to do it through pyGitHub and python, but knowing how to close an issue through the GitHub API would be enough to let me figure it out. Can anyone point…
Bar Smith
  • 797
  • 6
  • 20
5
votes
2 answers

Read content of file which is in GitHub using PyGitHub

Let’s say "sample.txt" file is in GitHub under the "Demo" repository [Demo/sample.txt]. How can I read the content of sample.txt using PyGitHub instead fetching from the API? Else, do we have some other package to read such file content?
5
votes
0 answers

Using SSH keys with pygithub

How do I authenticate with github.com using pygithub and ssh keys? I can authenticate just fine with an access token. For various corporate type reasons, it would be extremely convenient to use SSH keys for the script I am writing. I have found a…
Mark Hattarki
  • 123
  • 2
  • 8
1
2 3
13 14