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...

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).

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...

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 =...

How to push local files to github using python? (or post a commit via Python)

What options are there for commiting and pushing files to github from python? Here are three methods I thought should be feasible so attempted in order: Use pygithub: (Github's python API) to...

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...

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...

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...

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':...

Rename git branch name on remote using PyGithub

How can I rename github remote branch using PyGithub python API ?

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...

How to place a created file in an existed GITLAB repository through python

I have created a text file using file operations in python. I want the file to be pushed to my existed GITLAB repository. I have tried the below code where i get the created file in my local...

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...

How to download a GitHub release asset from a private repository in python?

I'm using pygithub and i'm getting the proper assets I want to download, but I can't figure out how to actually get them because they're in a private repository. I've found similar questions here...

PyGithub authentication troubles

I am using PyGithub with an access token from Github I got here to create a command line tool with click. My code is as follows: from github import Github def readEnvironment(): 'This...

Read content of file which is in Github using pyGithub?

Let say "sample.txt" file is in GitHub under "Demo" repo [Demo/sample.txt], how can I read the content of sample.txt using pyGithub instead fetching from API ? Else do we have someother package...

pygithub - Receive all commits of a specific branch

I am using pygithub for analyzing repositories and iterating on all commits of a repository. But how can I extract the corresponding branch for each commit? commits = repo.get_commits() for commit...

pyGithub Pull request invalid head (422 API error)

Recently I've been trying to use pyGithub to create some automated PRs after running a make update in a bunch of repos using this snipppet. body = 'Test PR 2 please ignore' pr =...

PyGitHub - Error 403 {"message": "This API returns blobs up to 1 MB in size

I am working on a Python script to automatically create files on Github and if they exist, update them. I am using the module PyGithub with the logic below. The problem I have is that when I try...

pygithub create pull request GithubException "not all refs are readable"

I am using Pygithub to trying to create a pull request. # push branch cmd = ["git", "push", "origin", "HEAD:refs/heads/my-branch"] subprocess.run(cmd, check=True) ... # then create PR repo =...

how to get github pull request all reviewers using python (pyGithub)

I'm using pyGithub to interact with github, i'd like to get all reviewer list for a pull request. There's a api pullrequest.get_review_requests() which only returns people who were asked for...

account name in PyGithub

I am using the package PyGithub in order to try and automate the creation of a new github repo. from github import Github g = Github(token) user = g.get_user() repo =...

can you delete a repo via pygithub?

Can you delete a repo using pygithub? For example, as shown in this example, you can delete a file like so: repo = g.get_repo("userName/repoName") contents = repo.get_contents("filename.txt",...

Python progress bar for PyGithub clone function

How can I see the progress of a cloning process? tqdm module does not work for single line statements. Is there a git argument that I should add? Any references would help. Thanks. import...

Getting error "'Repository' object has no attribute 'create_deployment'" when using the PyGithub API

I am trying to use PyGithub (https://pygithub.readthedocs.io/en/latest/apis.html) to get the deployment and report the status somewhere else. I have the following script: from github import...

An unclear requirements.txt error which results in not being able to install

From today, I started getting error while installing modules from requirements.txt, I tried to find the error module and remove it but I couldn't...

How to install multiple python namespace packages in editable mode

I created multiple packages according to the PEP420 implicit namespace packaging method. Two of those distribution packages are dende-github-api and dende-gitlab-api. Each of those distributions...

PIP not able to install dependencies

I have built and published a package to pypi using poetry build, and have also specified dependencies which it uses inside pyproject.toml [tool.poetry.dependencies] python = "^3.6" PyGithub =...

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...

Github "Requires Authentication" Error when using PyGithub

I was trying to figure out how to use the PyGithub module, but I keep getting the same error: github.GithubException.GithubException: 401 {"message": "Requires authentication",...