Python 爬取Github上Star最多的python项目并可视化
2019-04-08 01:44
1996 查看
版权声明:转载请注明原文地址即可,要是本文对您有些许帮助的话,请您在下方点个赞,谢谢啦ヾ(o◕∀◕)ノヾ https://blog.csdn.net/qq_33583069/article/details/89078973
import requests import pygal from pygal.style import LightColorizedStyle as LCS,LightenStyle as LS URL = 'https://api.github.com/search/repositories?q=language:python&sort=stars' r = requests.get(URL) print("Status code:",r.status_code) response_dict = r.json() print("Total repositories:",response_dict['total_count']) repo_dicts = response_dict['items'] # print("Repositories returned:",len(repo_dicts)) # print("\nSelected information about each repository:") # for repo_dict in repo_dicts: # print("\nName:",repo_dict['name']) # print("Owner:",repo_dict['owner']['login']) # print("Stars:",repo_dict['stargazers_count']) # print("Repository:",repo_dict['html_url']) # print("Description:",repo_dict['description']) names,stars = [],[] for repo_dict in repo_dicts: names.append(repo_dict['name']) stars.append(repo_dict['stargazers_count']) my_style = LS('#333366',base_style=LCS) chart = pygal.Bar(style=my_style,x_label_rotation=45,show_legend=False) chart.title = 'Most-Starred Python Projects on Github' chart.x_labels = names chart.add('',stars) chart.render_to_file('python_repos.svg')
相关文章推荐
- 从15000个Python开源项目中精选TOP30,GitHub平均star为3707,赶紧收藏!
- 从15000个Python开源项目中精选的Top30,Github平均star为3707,赶紧收藏!
- 2016年度GitHub上Stars最多的10个Python项目
- 从15000个Python开源项目中精选的Top30,Github平均star为3707,赶紧收藏!
- 从15000个Python开源项目中精选的Top30,Github平均star为3707,赶紧收藏!
- 从15000个Python开源项目中精选的Top30,Github平均star为3707,赶紧收藏!
- GitHub最著名的20个Python机器学习项目,值得收藏!
- 在github上托管了一个面向石油工程的python小项目
- Github上Stars最多的53个深度学习项目,TensorFlow遥遥领先
- Github上Stars最多的53个深度学习项目,TensorFlow遥遥领先
- GitHub可视化项目,你了解多少?
- GitHub 上最火的 Python 开源项目zz
- Github社区python项目数据分析
- GitHub最著名的20个Python机器学习项目!
- Github上关注最多的53个深度学习项目
- github上为项目添加协同开发者;python Built-in Functions
- python爬虫---->github上python的项目
- 【Deep Learning】Github上关注最多的53个深度学习项目
- 我的第一个GitHub开源练习项目-OuNews新闻阅读软件(求Star求Fork_(:з」∠)_)