github-api

How to flatten dict in a DataFrame & concatenate all resultant rows

How to flatten dict in a DataFrame & concatenate all resultant rows Question: I am using Github’s GraphQL API to fetch some issue details. I used Python Requests to fetch the data locally. This is how the output.json looks like { "data": { "viewer": { "login": "some_user" }, "repository": { "issues": { "edges": [ { …

Total answers: 2

Unable to use Github API with authentication tuple

Unable to use Github API with authentication tuple Question: query = "https://api.github.com/repos/rhinstaller/anaconda/tags" response = requests.get(query,auth=(self.username,self.token)) response.raise_for_status() # raises exception when not a 2xx if response.status_code != 204: try: data = response.json() print("data = ",data) except: print("0") The above code always returns data as empty whereas response = requests.get(query) will still work until the rate is …

Total answers: 1

Missing secret gists in GitHub's API

Missing secret gists in GitHub's API Question: According to the documentation, I can either send the request with authorization (token) in order to get all of my gists, or anonymously and I will get public popular gists. My Python code is: url = "https://api.github.com/gists" with Get( url, headers={"Accept": accept}, params={"since": since, "per_page": per_page, "page": page}, …

Total answers: 2

Get github username through primary email

Get github username through primary email Question: 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 proceed invite accordingly? I know it is possible through UI, but can’t …

Total answers: 4

Posting to a Gist with Github API

Posting to a Gist with Github API Question: I’ve been trying to write to a gist using Python urllib2 with the following: def _log_error(information, date=datetime.date.today(), current_time=time.strftime(“%H:%M:%S”)): log_string = “”” Info: {} Date: {} Time: {} “””.format(information, date, current_time) filename = “<file>” token = “<token>” access_url = “https://api.github.com/gists/{}”.format(filename) req = urllib2.Request(access_url) req.add_header(“Authorization”, “token {}”.format(token)) req.add_header(“Content-Type”, “application/json”) …

Total answers: 3