Questions tagged [github3.py]

github3.py is one of the most highly recommended wrappers for version 3 of GitHub's API written in Python

Filter by
Sorted by
Tagged with
6
votes
1answer
2k views

How can I find all public repos in github that a user contributes to?

I'm using the github3 python library and am trying to find all public repos that users from our organization have contributed to (to reward the support of open source!). I've got the list of users for ...
5
votes
2answers
400 views

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 can ...
3
votes
1answer
1k views

Count total number of lines in a github pull request file

I'm using the github3.py library to query changes in files associated with pull requests. I have the code written below that retrieves the total number of line changes made to the file. I would like ...
3
votes
1answer
301 views

Getting committer emails

I am trying to get the email addresses of the committers of a project to specific files. After creating a query that finds the code files in a list of repos matching specific criteria, I get the ...
3
votes
1answer
78 views

AttributeError: 'PullRequest' object has no attribute 'issue_comments'

I'm using https://github.com/sigmavirus24/github3.py and I'm having problem with getting issue_comments from PR. for pr in repo.iter_pulls(): for comment in pr.issue_comments(): print ...
2
votes
2answers
3k views

github3 0.9.6 TypeError:pop() takes at most 1 argument (2 given)

I am currently using github3.py version 0.9.6, and am receiving an error upon invoking the github3.organization(login) function: Traceback (most recent call last): File "Main.py", line 23, in <...
2
votes
1answer
2k views

To get all github users details

I want to get the github users and their location. I know there is Github apI(GET /users) which can provide me the list of user. Currently I am using PyGithub to access the github but seems this ...
2
votes
1answer
89 views

Python Github3 library how to get the exact content of generator of ShortOrganization

I'm using the Github3 library to access the Github Enterprise API. I'm trying to get all organizations a specific user has, but after I got the generator of ShortOrganization, I don't know how to ...
2
votes
1answer
874 views

GitHub API get issues description using Python

The task: (using GitHub API) 1) get all closed milestones for a given repo 2) get all issues for that milestone 3) for every issue get it's description 4) finally, using Markdown for example, create ...
2
votes
1answer
514 views

Is there an easy way of reverting an already merged Pull Request using the API?

github provides a "Revert" button in it's web interface, which allow us to revert a pull request that was already merged. This always involves, to the best of my knowledge, creating a new pull ...
2
votes
1answer
134 views

List repos of a user

Hey I've been reading up on the github3.py, but can't find a clear explanation of how to retrieve a list of a user's repositories. It seems that there should be a simple solution like a method or a ...
2
votes
0answers
344 views

github3.py Repository class is there a way to “Create” a branch?

Using version 1.0.0a4 of the github3.py library. I am trying to create a new file in the repository on a new branch. Assumption: gh is an authenticated object. repo = gh.repository('User','Repo') ...
1
vote
2answers
1k views

How to create an issue comment on a pull request?

According to this question a PR is just an issue with some things on top. How to get the associated issue id? I just saw issue_url as attribute for the pull request object. Also, PR has the ...
1
vote
1answer
220 views

Why does github3.py ask for a second authentication factor twice?

I'm using github3.py to access my organization's Github account, and we have two-factor authentication enabled. I'm starting by listing the repositories. Here's the code: import os import github3 ...
1
vote
2answers
149 views

“InvalidSchema” when attempting to create file with github3.py

Using github3.py 1.0.0a4, I am trying to make a basic "server" program that creates, updates, deletes, and fetches files. However, my program raises "InvalidSchema" on attempt to create a file. Why? I ...
1
vote
1answer
186 views

User Attribute Errors on github3.py Login

Recently had a fun project idea and wanted to utilize the GitHub API, so I searched around for a Python wrapper. On the GitHub libraries page I found github3.py After looking at their docs I get an ...
1
vote
1answer
153 views

Github3.py 1.3.0 Get timestamp for commit

I looked through the documentation and even the source code and I can't seem to figure out how to get the timestamp of a commit using the github3.py library. I'm, pretty sure it's there because, well, ...
1
vote
1answer
104 views

github3.py v1.3.0 AttributeError: iter_repos

I am trying to iterate over all repositories in a private organization. Here is some example code that does not work on my machine (Windows 10, Python 3.6.5): import github3 session = github3.login(...
1
vote
1answer
176 views

Add image to pull request comment

I'm using the github3.py library to create a comment in a pull request from the columns field in a csv file. I would like to add an image to the comment along with the output from the columns, but I ...
1
vote
1answer
142 views

Why are my PRs being auto-closed?

My company is using github enterprise and I am using github3.py API to automatically create pull requests. I have code as follows: detailed = "%s: Auto Pull Request from '%s' %s" % (base, ...
1
vote
1answer
2k views

How to create a Pull Request using github3.py API?

This seems to be supported in the github web api, but I found no example in the docs and it doesn't seem to have been implemented in the API. Am I missing something? Is it possible to create a PR ...
1
vote
1answer
92 views

Can github3.py be used to find the parent/upstream of a forked repo?

Given a forked repo, how can I use github3.py to find the parent or upstream repo that it was forked from? This is fairly easy with requests but I can not figure out how to do it in github3.py. With ...
1
vote
1answer
604 views

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 ...
1
vote
1answer
105 views

github3.py AttributeError with IssueEvents

I've got some code which has been using github3.py successfully to iterate through issues in a repo and pull out various stats. All of a sudden I'm getting an error when trying to iterate the events ...
1
vote
1answer
119 views

github3.py doesn't return file content for gist

I use github3.py library in order to create and update Gist on github.com I can access an existing gist and get all information except content of the file: for g in gh.iter_gists(): if g.id == ...
1
vote
1answer
302 views

github3.py. Empty list of commited files

I developing a web service which uses some Github info. I need to get a list of files which changed with a commit. I found a list of libraries. I tried all 3 Java libraries and github3.py. And all ...
1
vote
1answer
197 views

Gaining an OAuth Token from a Web Flow Login on GitHub

I started to integrate GitHub3.py, and from what I have seen it appears to be an excellent library for my use. However, I'm a little confused on how to go forward and get using the library in my ...
1
vote
0answers
30 views

Github3.py returns only issues till May 2020 (1000 issues) but I need for past 2 years and then wish to plot using Line Chart

import github3, json, os.path gh = github3.login(token="d6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")#Access token REPO = 'angular'#name of repository ...
1
vote
1answer
25 views

GItHub App access to repositories in organization

I have a Github App created under an organization and is installed to a repository under same organization. I tried reading a file from the same repository after authenticating using github3 ...
1
vote
2answers
133 views

How to obtain the github organization and repository name from a local clone repository with python?

Apparently github3 module does require you to feed it github organization and repository name as is not able to guess them based on your current repository. I also checked the https://pypi.org/...
1
vote
0answers
73 views

github3.repos.contents.content return an empty object

I want to get the content of a file that it's storing configuration. I'm using the following code: repos = [f for f in gh.iter_user_repos(git_org, branch)] modules = {} modules_infos = {} for a in ...
1
vote
1answer
130 views

How do you make a django field reference to a python class?

I am working on a project to expand a testing suite that my company uses. One of this things that was asked of me was to link the website to our Github source for code so that the dev team could ...
0
votes
2answers
1k views

How to get GitHub user names and emails for a specific team or repository

How would one use Python and the GitHub API to obtain user details (user name, email, location) for a particular team (or repository)? The teams are not public, but I am a member of the team I'm ...
0
votes
1answer
135 views

Using github3.py, how do I increase GitHub's rate limit using only client_id and client_secret?

I want to increase GitHub's rate limit by passing client_id and client_secret with the request. I don't want to use user/pass or OAuth authentication. I just want to make a request equivalent to: ...
0
votes
1answer
673 views

create_hook Validation Error 422

I have been playing with the parameters for awhile now but I continue to get the same 422 Validation Error. I am using runscope to test if my webhooks work. url_path = "https://k1lavjuzlcvj.runscope....
0
votes
1answer
27 views

Can't have authorization for the app_installations methode

I'm working on a github application and my actual task is to retrieve list of github user account / github organization on which the app has been installed. So basically, I'll be using the ...
0
votes
1answer
42 views

Clone a Githubenterprise Repo using python libraries

I am using github3.py library for my remaining code modules. So if possible can we use github3.py lib for cloning a repo or any other python library is also good.
0
votes
1answer
102 views

github3.py login using ssh keys

Is there a way to use github3.py python library to access github with a SSH key? I'm trying to create a service that writes on some repositories using a machine user for security reasons.
0
votes
1answer
662 views

list tags and tag content using github3

We tag commits on a weekly basis, and I want to issue a report to see the tag names and their content, I tried the following using python 3.x and github3 import github3 g = github3.login(token='...
0
votes
1answer
179 views

How to pull only modified commits/pull requests using github3.py?

I'm writing an ETL job where I keep an updated list of commits, pull requests, and files from our GitHub repos in our data warehouse. I'm currently storing and passing in etags to the various ...
0
votes
1answer
257 views

Recommended way to list all repos/commits for a given user using github3.py

I'm building a GitHub application to pull commit information from our internal repos. I'm using the following code to iterate over all commits: gh = login(token=gc.ACCESS_TOKEN) for repo in gh....
0
votes
1answer
224 views

How to get contents of a file from certain tag

I'm writing an update script for project, where remote code should update certain files according to provided version number. For this purpose tags (releases) are created in github. Now I would like ...
0
votes
1answer
2k views

TypeError: 'GitHubIterator' object does not support indexing [duplicate]

Using github3.py, I want to retrieve the last comment in the list of comments associated with a pull request and then search it for a string. I've tried the code below, but I get the error TypeError: ...
0
votes
1answer
239 views

Why does my repository object return Nonetype with github3.py?

Using github3.py version 0.9.5 documentation, I'm trying to create a repository object but it keeps returning Nonetype and therefore I am unable to access the contents of the repository. There doesn't ...
0
votes
1answer
434 views

Is there a way to get Tag objects instead of Reference ones when listing tags from a repository?

I'm able to successfully list tags from a repository using github3 using: repo.iter_refs(subspace='tags') That results in a generator of github3.git.Reference objects. Is there a way for me use a ...
0
votes
1answer
90 views

What's the corresponding call for create-status in github3.py API?

In githubV3, we have a way to create status for branches (refs). I want to perform this call using github3.py. I am using version 0.9.3. Can I do that?
0
votes
1answer
197 views

Why aren't conversation comments in a pull request being returned from PullRequest.iter_comments()?

I am using github3 python API and I have this piece of code: # Create new PR or get existing one prs = [pr for pr in repo.iter_pulls(state="open", base="master", ...
0
votes
1answer
136 views

github3.py: Possible to use with grequests?

I wonder if this has ever come up before? I have an app that downloads tons of information from our GitHub Enterprise instance (not currently using github3.py but I am thinking of converting it over ...
0
votes
1answer
342 views

How to get location of all user without hitting github API usage limit

Currently I am trying to get all Github user location. I am using github3 python library to get the location. But it gives me over-API usage error when my api calls are more than 5K. Here is my code. ...
0
votes
1answer
28 views

How to put labels on new pull request using github3.py?

I saw that github3.py still doesn't have the attribute labels on Repository.create_pull() as in Repository.create_issue(). But there is the property labels on ShortPullRequest created. So I tried: ...