在Github中,是否有一种方法可以让我看到回购的下载数量?
当前回答
要查看发布文件/包被下载的次数,您可以访问https://githubstats0.firebaseapp.com
它会给你一个总下载计数和每个发布标签的总下载的细分。
其他回答
访问者数量应该可以在你的仪表板>流量(或统计数据或见解):
很晚了,但这是你想要的答案:
https://api.github.com/repos/ [git username] / [git project] /releases
接下来,在数据中找到您要查找的项目的id。它应该在顶部附近,在url旁边。然后,导航到
https://api.github.com/repos/ [git username] / [git project] /releases/ [id] / assets
名为download_count的字段就是答案。
编辑:在你的用户名和项目名中大写字母很重要
如前所述,GitHub API返回二进制文件发布的下载计数。我开发了一个小脚本,通过命令行轻松获得下载计数。
为了更清楚地说明这一点: 对于这个github项目:stant/ mdcsvimportter2015 https://github.com/stant/mdcsvimporter2015 在 https://github.com/stant/mdcsvimporter2015/releases
转到HTTP或https:(注意添加了“api.”和“/repos”) https://api.github.com/repos/stant/mdcsvimporter2015/releases
你会得到这个json输出,你可以搜索"download_count":
"download_count": 2,
"created_at": "2015-02-24T18:20:06Z",
"updated_at": "2015-02-24T18:20:07Z",
"browser_download_url": "https://github.com/stant/mdcsvimporter2015/releases/download/v18/mdcsvimporter-beta-18.zip"
或者在命令行执行: Wget——no-check-certificate https://api.github.com/repos/stant/mdcsvimporter2015/releases
这里是一个使用pip install PyGithub包的python解决方案
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))
推荐文章
- 了解Git和GitHub的基础知识
- 在GitHub上有一个公共回购的私人分支?
- 只用GitHub动作在特定分支上运行作业
- Git合并与强制覆盖
- 是否有一个链接到GitHub下载文件的最新版本的存储库?
- GitHub -致命:无法读取用户名https://github.com':没有这样的文件或目录
- Github:我能看到回购的下载数量吗?
- 如何运行一个github-actions步骤,即使前一步失败,同时仍然失败的工作
- 当我试图推到原点时,为什么Git告诉我“没有这样的远程‘原点’”?
- 在GitHub repo上显示Jenkins构建的当前状态
- 如何取消在github上的拉请求?
- HEAD和master的区别
- 在另一个目录中运行操作
- GitHub克隆与OAuth访问令牌
- 我可以在GitHub上对要点进行拉请求吗?