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

Github REST API ... go-github seems to lack features in PyGithub?

I have a working script that accesses the Github REST API (v3) to (a) submit a search query and get results, and then (b) iterate through search results to download individual source code files for more processing. The original script uses Python +…
David Jones
  • 2,139
  • 2
  • 19
  • 20
0
votes
1 answer

I need a faster way to find repos with PyGitHub

My organization has a ton of repos in GitHub. I have a subset of these repos that I want to programmatically detect. All of the repos I want start with the same string. The code below correctly finds them, but it takes about a minute to do it…
Cyberclops
  • 311
  • 2
  • 17
0
votes
0 answers

How to make changes via PyGitHub stick

This is my first experience using PyGitHub. I have written code to update my repo using repo.create_file, repo.update_file and repo.delete_file, but after execution, these changes are not reflected in GitHub. When using git from the command line I…
Cyberclops
  • 311
  • 2
  • 17
0
votes
1 answer

How to get field value from another screen?

I have a field in the TokenScreen , and I have a MDList in the ListScreen. The problem is , that I can't find a way to get a value from the field in the TokenScreen , and pass it to the ListScreen class , in order to fill the container with widgets.…
0
votes
1 answer

How to get number of lines of code of a file in a remote repo using PyGithub/ Githubsearch api?

commit = repo.get_commit(sha="0adf369fda5c2d4231881d66e3bc0bd12fb86c9a") print(commit.stats.total) i = commit.files[0].filename I can get the filename, even the file sha; but can't seem to get loc of the file. Any pointers?
0
votes
1 answer

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 Github # Github Enterprise with custom hostname g =…
harry123
  • 760
  • 1
  • 7
  • 22
0
votes
1 answer

Github Python API accessing file content after get_files()

I'm looking to access the content files that were changed in a github pull request using pygithub. I've managed to get a list of the files using repo = gh.get_repo(repo_url) pr = repo.get_pull(30) for file in pr.get_files(): print(file) But I…
FortuneFaded
  • 1,259
  • 4
  • 20
  • 28
0
votes
1 answer

repo.checkout() : Your local changes to the following files would be overwritten by checkout

I am using the following code to get the bug fixing commits in a list of GitHub repositories. def get_commit_bug_fixing(self): EMPTY_TREE_SHA = "4b825dc642cb6eb9a060e54bf8d69288fbee4904" detected_sml = [] …
user1603454
  • 99
  • 1
  • 8
0
votes
0 answers

Push Data to Online GitHub Repo using Python

I am seeking input on how to effectively utilize Python to commit and push a single file to an online GitHub repository. The use case is pretty simple - I am pulling some data down from an API once per day, and I would like to send the pulled data…
0
votes
0 answers

Pushing local repository to remote repository using python Github

The code should do the following in order: It should download/clone the public Github repository locally. The should remove all the git history (and branches) Use the Github API to create a new Github repository initialized with the input github…
KrisTej
  • 75
  • 4
0
votes
1 answer

PyGithub `Repository.compare(base, head)` not working

I am trying to run a compare in out GitHub Enterprise Repo with PyGitHub. My Code looks like this: repo = github.get_repo("my/repo") log.debug(f"The Repo: {repo}") log.debug(f"The URL: {repo.compare_url}") labels =…
keineantwort
  • 873
  • 8
  • 15
0
votes
1 answer

Creating repo on authenticated user with pyGithub throws exception

Everything goes smoothly until I invoke create_repo on AuthenticatedUser from get_user(). No matter what I try it always throws an exception: [ERROR tornado.application web:1599] Exception in exception handler Traceback (most recent call last): …
Marco Cano
  • 367
  • 1
  • 4
  • 18
0
votes
1 answer

github get users merged lines of code from a specific date range

I have been searching Github documentation well as pygithub documentation as well on how I could get the stats for each users committed and merged lines of code into the master branch from a specific date. So far the best i could find is under…
Max Powers
  • 1,119
  • 4
  • 23
  • 54
0
votes
1 answer

How to search github repositories by spoken language PyGithub Python

The new Github trending page allows you to search repositories by spoken language e.g. English, I'm looking for the syntax to use with PyGithub. Is it just: g.search_repositories(query='spoken-language:english') Thanks
Luke Prior
  • 885
  • 2
  • 11
  • 34
0
votes
1 answer

PyGithub: how to search for multiple topics using get_repositories

Using PyGithub, I'm trying to search for github repositories using multiple topics. This works for one topic: Github.search_repositories("topic:topicname1") But how do I add others? I've tried "topic:topicname1+topic:topicname2" but that doesn't…