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
2
votes
3 answers

Find all files with certain filetype on GitHub

We are currently building a small search engine for which we want to crawl GitHub for publicly available KiCad schematics. However, we are unsure how to get these using the GitHub API as efficiently as possible. This is our current approach: Search…
Gasp0de
  • 1,199
  • 2
  • 12
  • 30
2
votes
2 answers

cannot authenticate/connect to github using pyGithub

I am new to using pyGithub and I want to do some updates to issues in an enterprise repository using a python script. I am struggling to get it to connect. I have used similar to…
G J
  • 33
  • 6
2
votes
2 answers

sha/hash for new github branch

Just started using github in-depths so im' still learning. I want to use python GitHub api (currently i'm using PyGithub) to create new branch, commit, issue pull request automatically. Couples of things that are confusing me... Any help would be…
Trouble
  • 51
  • 3
2
votes
3 answers

PyGitHub: Unable to access private repositories of my team

I want to access a private repository of a team that I am part of. However, I am not able to access it. It throws an exception as follows: UnknownObjectException: 404 {u'documentation_url': u'https://developer.github.com/v3/repos/#list-teams',…
Tjs01
  • 457
  • 2
  • 8
  • 14
2
votes
1 answer

Gracefully catch python Exception in Iterator next

I am using PyGithub to scrape some repositories, though I get some error while iterating through the search pages. def scrape_interval(self, interval): for repo_number, repo in self.search(interval): code... def search(self,…
ajthinking
  • 3,386
  • 8
  • 45
  • 75
2
votes
3 answers

pyGithub maximum use of API call rate

I am attempting to use the pyGithub library for accessing v3 API of github. Although this library is simple to use. I found the documentation to be very vague. Below I am successfully getting the contents of a file with the file path and its sha.…
XChikuX
  • 766
  • 1
  • 9
  • 33
2
votes
1 answer

Pygithub - Organization Repo - Access Pull Requests Details

I am using Pygithub for a public repo , I am new to it, how do I access my organization repo(private) Pull Request details , given that , from my settings i had generated OAuth Tokens and Private Tokens.
2
votes
0 answers

show git diff by using PyGithub

For example, I have a file t.json, the content is: { "a": "abcdefg" } And file t.json is pushed to to master branch. Then I add some content to the file, so the file looks like this now: { "a": "abcdefg", "b": "mkjuujj" } Now I can compare…
ypeng
  • 151
  • 1
  • 8
2
votes
1 answer

Create file in GitHub repository with PyGithub

I have the following code: import github token = "my gitHub token" g = github.Github(token) new_repo = g.get_user().create_repo("NewMyTestRepo") print("New repo: ", new_repo) new_repo.create_file("new_file.txt", "init commit", "file_content…
Sergey Luchko
  • 2,996
  • 3
  • 31
  • 51
2
votes
1 answer

How to get all user repositories by github api? (including Pinned repositories)

I' trying get all user's repositories by using PyGithub. For clarity the user: https://github.com/mbostock has 53 public repos. my code: import github con = github.Github(mylogin, pass) u = g.get_user('mbostock').get_repos('all') and I get 53, It's…
Sergey Luchko
  • 2,996
  • 3
  • 31
  • 51
2
votes
2 answers

Github API: how to check if repository is empty?

I'm using pygithub3 library to parse user repositories, but from time to time, it crasshes on assertion after failed request. At first I suspected that I have hit rate limit, but soon I realized that I can 100% reproduce assertion on 'empty'…
Tomas Pruzina
  • 8,397
  • 6
  • 26
  • 39
2
votes
0 answers

ssl.SSLError: [SSL:CERTIFICATE_VERIFY_FAILED] while running in uwsgi

I am using the pyGithub plugin. When running in a normal python process, I am able to access Github appropriately. When running within the context of uwsgi, I get: File…
supreme Pooba
  • 868
  • 1
  • 7
  • 14
2
votes
2 answers

Get Latest Commit URL from PyGithub Efficiently

I'm using this function to get the latest commit url using PyGithub: from github import Github def getLastCommitURL(): encrypted = 'mypassword' # naiveDecrypt defined elsewhere g = Github('myusername', naiveDecrypt(encrypted)) org =…
Chris Redford
  • 16,982
  • 21
  • 89
  • 109
1
vote
0 answers

Github Api (PyGithub) delete/undo last commit to branch

Background I am using a fork of the upstream repository where I created my own branch. I can commit to this branch and then create a pull request to the upstream. Committing again to the fork will naturally update the PR as well. This all works. The…
1
vote
0 answers

How to get_projects() from github repo using PyGithub?

I'm trying to fetch projects from a github repo using PyGithub 1.58.1. I created those projects manually in browser and I can see them.  But when I see repo.get_projects().totalCount, it's giving 0.  and when I try to create a project, it…
Underoos
  • 4,708
  • 8
  • 42
  • 85