这个需求也比较明确,目前GitHub的页面上并不提供对某个项目Star随时间变化的数据,但实际上可以通过GitHub API获取,在之前的一篇日志中
<https://blog.csdn.net/qysh123/article/details/79626894>,我简单介绍了通过curl使用GitHub
API的方法,不过正如这里 <https://developer.github.com/v3/guides/getting-started/>介绍的:

Most applications will use an existing wrapper library
<https://developer.github.com/libraries/> in the language of your choice, but
it's important to familiarize yourself with the underlying API HTTP methods
first.


我们这里选择使用PyGitHub这个library:https://github.com/PyGithub/PyGithub
<https://github.com/PyGithub/PyGithub>。

还是以bitcoin这个项目为例,要print出所有star的用户和具体时间,只需要下面这些代码:
from github import Github g=Github("自己申请的Token")
repo=g.get_repo('bitcoin/bitcoin') stargazers=repo.get_stargazers_with_dates()
for people in stargazers: print people.starred_at print people.user
实际上很简单,首先生成主类GitHub:http://pygithub.readthedocs.io/en/latest/github.html
<http://pygithub.readthedocs.io/en/latest/github.html>

再使用Repository这个class中的method:
http://pygithub.readthedocs.io/en/latest/github_objects/Repository.html
<http://pygithub.readthedocs.io/en/latest/github_objects/Repository.html>

就简单总结这么多。



友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:637538335
关注微信