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
1 answer

```AttributeError``` when attempting to call a repo action

I am receiving an error message of AttributeError when attempting to call a repo and its actions. This is my current code: from github import Github #Authenticate with GitHub g = Github("", "") #Replace , with your user…
1
vote
0 answers

"BadCredentialsException" error in jupyter when trying to call a github repo

Hello so I am receiving this error BadCredentialsException: 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest"} when attempting to call a specific repository. I am using jupyter right now because VS code was not…
Jayy Griff
  • 19
  • 3
1
vote
1 answer

How to enable Require status checks to pass before merging through automation

I was reading over PyGitHub's documentation in: https://pygithub.readthedocs.io/en/latest/github_objects/Branch.html and found some interesting methods that I thought might help First I made sure that Required status checks to pass before merging…
DevopitionBro
  • 111
  • 1
  • 6
1
vote
1 answer

PyGithub: How to create a branch off the master and check out?

How can I create a new branch off the master and check out the branch? The documentation at https://pygithub.readthedocs.io/en/latest/ does not show how to do this. Thanks a lot!!
Kay
  • 1,235
  • 2
  • 13
  • 27
1
vote
0 answers

Uploading multiple files to release on Github using Python

I am trying to create a release and upload all files with a specific ending as an asset. My code is as follows: # This uploads all apkg files in the current directory to a release on GitHub. import github import dotenv import os import…
Pux
  • 421
  • 3
  • 18
1
vote
1 answer

Python test patch is never called

I am trying to test with my code by mocking the PyGithub library. I want to create a repository for an organization. So first I need to get it and on the "Organization" returned object, I need to make another call. It fails when trying to assert…
1
vote
1 answer

How do I programmatically extract GitHub repositories that contain a code string?

I am looking for a way to extract GitHub repositories containing files with a certain code string. I can do manually using the GitHub search bar. For instance, if I'm looking for the usages of the library pymc3 I could look for it in the search bar…
desert_ranger
  • 1,096
  • 3
  • 13
  • 26
1
vote
1 answer

Github API - how to get pull requests newer than some date

Corresponding to the official DOC, I prepare the following URL: https://api.github.com/repos/gooddata/gooddata-python-sdk/pulls?per_page=10&page=1&sort=updated&direction=asc&state=all&q=updated:%3E=2022-06-01 It returns the first 10 pull requests in…
1
vote
0 answers

How to iterate a paginatedList faster with PyGitHub?

I want to iterate the items of a paginatedList in a fast way but, when I apply a method to the paginatedList, then it takes too much time to execute the program. Example ''' plist = user.get_starred() for starred in plist.__iter__(): …
Iron_Ale
  • 11
  • 2
1
vote
1 answer

How to create github webhook on repo deletion

I have created Oauth App to get user token and i'm using PyGithub to create repos and add hooks/events to them. I'm trying to figure out if a repo the Oauthapp created is deleted using a webhook. The available hooks list includes tracking of…
Mostafa Mohamed
  • 816
  • 15
  • 39
1
vote
1 answer

PyGitHub .RateLimitExceededException: 403 Authentication Trouble

I have been attempting to use PyGitHub to edit/update my repository files using PyGitHub, however (I guess I tried to access it too many times :P) it gives me this error: github.GithubException.RateLimitExceededException: 403 {"message": "API rate…
1
vote
1 answer

How to call a function from a file in a git repository and use it in local notebook

I have a git repo ,which has a python file and in that file I have defined a function. for eg : import pandas as pd def return_square(num): return num*num This is my function in a file square.py in git repo math_calculation math_calculation --…
Shubh
  • 585
  • 9
  • 29
1
vote
0 answers

Correct way to combine query terms using boolean logic in Github repo search (Pygithub)

I'm using the search_repositories() function from the Pygithub package and am looking to build a query something like this in pseudo code: ('keyword1' OR 'keyword2) AND ('keyword3' OR 'keyword4') AND last_push_date > '2020-01-01' So far I've not…
laurie
  • 965
  • 1
  • 11
  • 21
1
vote
1 answer

Setting the status name when setting the status on a GitHub commit

I'm setting the status of commits to block Pull Request merges from an AWS CodeBuild job. I'm using PyGithub. Here's my code: repo.get_commit(sha=sha).create_status(state=state,description=description) I've set branch protection to block without…
Ken J
  • 4,312
  • 12
  • 50
  • 86
1
vote
0 answers

Getting API limit exceeded in GitHub api

I want to extract the github name,commit,repo,repo languages and contributrs from a github public profile using github api and python but Iam getting error that api limit exceeded and I am not able to figure hot to solve it. import base64 import…
Max_len
  • 41
  • 5