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

Pygithub Compare Commits on Single File

Fairly new to github and python but was looking for a method for comparing commits on a single file via Pygithub. I found this compare(base, head) but that seems to compare two branches. If I can't figure out how to do this in Pygithub I was going…
1
vote
1 answer

Get assignees and assigner via PyGithub

I'm using PyGithub to interact with GitHub API and trying to get assignees and assigner on issues. I implemented the following code, and it seem that assignee name and assigner name are not correct. For instance, clatoolkitdev2 was assigned by…
Koji
  • 509
  • 7
  • 21
1
vote
0 answers

when using pygithub, has occurred socket.gaierror

i try to use pygithub module, an error occurred in tutorial code. an error occurs that 'socket.gaierror: [Errno -2] Name or service not known', i don't know why. this is my tutorial code: user = Github("id", "password") publicRepos =…
1
vote
1 answer

How to set path for PyGithub method?

I'm working with PyGithub to get basic access to my own github repo. Most methods require a "path" and I'm not sure what that is. What parameters would I use in the .get_contents() function? Simple example: from github import Github g =…
maddyloo
  • 11
  • 2
0
votes
0 answers

pygithub search and read specific files

I am using pyGithub to go through the files in the Github repository. The problem is, with this code my_code.get_contents(""), it goes through each and every file in all the folders and subfolders in the repo. Is there a way to make this code…
nikhil
  • 1,578
  • 3
  • 23
  • 52
0
votes
1 answer

Download the latest relase file with token from private repo

I want to download files from my private repository using python. What should I do? I tried something like this, but it doesn't work. I also allowed everything in the token for testing, I get error again. import requests headers = {'Authorization':…
Teccno
  • 1
  • 1
0
votes
0 answers

PyGithub search_code query

I am using PyGithub, GitHub.search_code(query) for searching swagger/openapi files with apache/mit license: (path:/swagger.yml OR path:/openapi.json) AND (apache OR mit license). It gives me 3.7k results in Github advanced search. data_query =…
0
votes
0 answers

One hour expiration time for Github APP Installation token problem

I'm collecting data from several repositories (around 10k) from my organization for a AI search engine. I have written a python script (using PyGithub lib) to fetch the data, including a rate limit access that checks if the run time is close to 60…
0
votes
3 answers

How to to convert raw contents of a large file stored on github to correct bytes array?

I believe the recommended method to get the contents of a large file stored on GitHub is to use REST API. For the files which size is 1MB-100MB, it's only possible to get raw contents (in string format). I need to use this content to write into a…
Yulia V
  • 3,507
  • 10
  • 31
  • 64
0
votes
0 answers

Pygithub g.get_repo() working in local but not on github hosted and self hosted runners

I have a code which is working fine in my local but not on github actions. token = "some-token" repo_name = "customer-sandbox/some-repo" # org/repo format g = Github(token) repo = g.get_repo(repo_name) print(repo) On github and self hosted…
Underoos
  • 4,708
  • 8
  • 42
  • 85
0
votes
2 answers

How to read the contents of pdf files which encoding is `none`?

Upd: solved, see the comments below. When I try to read the contents of some pdf files I get an empty string. I have noticed that this happens to pdf files which encoding is none, and it works fine for pdf files which are identified as base64. The…
Yulia V
  • 3,507
  • 10
  • 31
  • 64
0
votes
0 answers

Using negative qualifiers with PyGithub

I am trying to use PyGithub to access GitHub REST API to search repos. Since, API has strict rate limits, I want to filter out as many repos possible during the search. Before, writing the script in Python, I tried GitHub's web search to get an…
akalanka
  • 553
  • 7
  • 21
0
votes
1 answer

cannot import module Auth form Github by PyGitHub

I want to try PyGitHub a Python library to access the GitHub REST API. python imterpreter: anaconda python 3.10 the first step, I install the command pip install PyGithub after that, I try to follow the tutorial to create a GitHub instance: from…
Bill
  • 11
  • 5
0
votes
0 answers

trying github python package - need to get the committer email in specific branch to send out notification

Am using circle ci to integerate with github and using slack for notification. My use case : is to get the emailid's of contributors to the specific branch so that i can notify those dev's regarding pipeline failure. is to get latest merged pr to…
Joe Pauly
  • 337
  • 3
  • 19
0
votes
1 answer

Get specific tag from repository using PyGithub

I have this very simple code using PyGithub from github import Github g = Github('') repo = g.get_repo("telefonicaid/fiware-orion") repo.get_git_tag("3.8.0") The repository is public (in fact, maybe the token is not needed...)…
fgalan
  • 11,732
  • 9
  • 46
  • 89