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
1
vote
0 answers

How to do "pull" command using Pygithub API

I'm not familiar with Pygithub API, I have done the "clone" action, but I don't know how to "pull" to update repositories that already cloned. I have "clone" repositories from github client = Github(base_url=f'https://{hostname}/api/v3',…
Jeff
  • 33
  • 4
1
vote
1 answer

How to add an outside collaborator to an individual organization repository using PyGithub?

I am writing a python application which uses GitHub using PyGitHub library. I have an organization which contains several private repos. I want to invite two different users and give them read-only access to two different repositories. I have been…
sshussain270
  • 1,785
  • 4
  • 25
  • 49
1
vote
3 answers

Anyway for GitHub api v3 to determine and give names of CODEOWNERS

https://help.github.com/en/articles/about-code-owners From the above documentation I’m trying to determine code and file owners of a particular file. I haven’t been able to find anything that gives this information within the GitHub documentation.…
sf8193
  • 575
  • 1
  • 6
  • 25
1
vote
1 answer

Rename git branch name on remote using PyGithub

How can I rename github remote branch using PyGithub python API ?
Sanjay Yadav
  • 769
  • 1
  • 6
  • 13
1
vote
0 answers

PyGitHub: Get private email address and Bio of the user

I am trying to fetch all the information related to the user using PyGitHub. However, when I try to get the Bio and email address of the users, it returns 'None' to most of the users. I think this users have marked to keep private using the…
Tjs01
  • 457
  • 2
  • 8
  • 14
1
vote
2 answers

How to get the number of contributors of Github repositories using Github API and PyGithub package

I am using following code to get the number of contributors of a repository from github import Github g = Github("*****github Access token****") repo = g.get_repo('mui-org/material-ui') contributors_count = repo.get_contributors().totalCount It is…
Arundhathi
  • 11
  • 2
1
vote
0 answers

Access GitHub repository through proxy

I am trying to get repositories from my Github ut I get following error: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /tejasshah2227/user/repos (Caused by…
Tjs01
  • 457
  • 2
  • 8
  • 14
1
vote
3 answers

PyGithub - how to get contents of the subfolder in the repo

I am trying to get contents of the subfolder "github" in a given github repository. This does not seem to work. repo = g.get_repo("PyGithub/PyGithub") contents = repo.get_contents("github") while len(contents) > 1: file_content =…
1
vote
1 answer

How do i properly authenticate to the github Api v3 using pyGithub. getting bad credentials error

I'm trying to use the Pygithub library for python to access my repositories through the github API v3. I'm following the tutorial given by the documentation and storing my credentials in another file called credentials. I checked to see that these…
1
vote
2 answers

Edit github gist through Python with pyGithub lib

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…
Dominic
  • 11
  • 1
1
vote
1 answer

How to get my private repositories in github using github3 library?

I have generated a github access token. I've tried to access the repos from pygithub and also github api v3, stuff was fine. Now using github3 I cannot access my private repos. I am using python(I know that you know). repos =…
hungryWolf
  • 391
  • 1
  • 3
  • 15
1
vote
2 answers

How to create a new repository in an organization with PyGithub

How can I create a new repository in an organization with PyGithub on Github? In particular I like to know how to use the create_repo method? My question is identical to this question, but I would like the created repository to appear in an…
Bar Smith
  • 797
  • 6
  • 20
1
vote
1 answer

Unicode issue with pygithub and django

I'm trying to connect to this org githubtraining This is my code on views.py: def home(request): global org email=request.GET['email'] password=request.GET['password'] g = Github("user", "paswword") org =…
NeoVe
  • 3,857
  • 8
  • 54
  • 134
1
vote
1 answer

PyGithub, can't get repos from enterprise

I am creating a bot with Spark (chat for enterprise), in Python, I use PyGitHub for the librairy. So when I write "repos" in my room with the bot he has to send me back the list of my repos. It works fine with my github personnal account but not…
Kravennagen
  • 77
  • 10
1
vote
1 answer

how to merge branch into master by 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, and checkout to a new branch so the file looks like this now: { "a": "abcdefg", "b":…
ypeng
  • 151
  • 1
  • 8