1

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 requests
from github import Github
from pprint import pprint
 
# Github username
username = "username"

# pygithub object
g = Github("github token")
# get that user by username
user = g.get_user(username)
print(user.name)
for repo in user.get_repos():
    print("REPO NAME :",repo.name)
    language = requests.get(f"https://api.github.com/repos/{username}/{repo.name}/languages").json().keys()
    print(language)
    try:
        commit = repo.get_commit(sha="master")
        print("COMMIT DATE AND TIME :",commit.commit.author.date)
    except:
        print("NA")
    contributors = requests.get(f"https://api.github.com/repos/{username}/{repo.name}/contributors").json()
    print("contributors :",contributors)

Max_len
  • 41
  • 5

0 Answers0