How to retrieve the list of all GitHub repositories of a person?

后端 未结 15 1262
一个人的身影
一个人的身影 2020-12-02 05:43

We are working on a project where we need to display all the projects of a person in his repository on GitHub account.

Can anyone suggest, how can I display the na

15条回答
  •  心在旅途
    2020-12-02 06:10

    Retrieve the list of all public repositories of a GitHub user using Python:

    import requests
    username = input("Enter the github username:")
    request = requests.get('https://api.github.com/users/'+username+'/repos')
    json = request.json()
    for i in range(0,len(json)):
      print("Project Number:",i+1)
      print("Project Name:",json[i]['name'])
      print("Project URL:",json[i]['svn_url'],"\n")
    

    Reference

提交回复
热议问题