Github: Can I see the number of downloads for a repo?

后端 未结 17 1036
甜味超标
甜味超标 2020-11-28 02:35

In Github, is there a way I can see the number of downloads for a repo?

17条回答
  •  渐次进展
    2020-11-28 03:08

    Here is a python solution using the pip install PyGithub package

    from github import Github
    g = Github("youroauth key") #create token from settings page
    
    
    for repo in g.get_user().get_repos():
        if repo.name == "yourreponame":
            releases = repo.get_releases()
            for i in releases:
                if i.tag_name == "yourtagname":
                    for j in i.get_assets():
                        print("{} date: {} download count: {}".format(j.name, j.updated_at, j._download_count.value))
    

提交回复
热议问题