import requests
import pygal
"""
 检查各种语言的仓库
"""
def find_language(language):
	url="https://api.github.com/search/repositories?q=language:"
	url+=language+"&sort=stars"
	r=requests.get(url)
	print("status code: ",r.status_code)
	#将api响应存储在一个变量中,转化为python字典
	response_dict=r.json()
	return response_dict
program_language=['Golang','c++','php','java','python','JavaScript'
			,'r','c#','Swift','ObjectiveC']

program_language_num=[]			
for v in program_language:
	language_dict=find_language(v)
	program_language_num.append(int(language_dict['total_count']))
#可视化数据
hist=pygal.Bar()
hist.title="github编程语言仓库数量"
hist.x_labels=program_language
hist.x_title="language"
hist.y_title="number"

hist.add('仓库数量',program_language_num)
hist.render_to_file('language_num.svg')
	

	

7a8433f1c16381f9a640981db3b606d11707af7e
<mask token>


def find_language(language):
    url = 'https://api.github.com/search/repositories?q=language:'
    url += language + '&sort=stars'
    r = requests.get(url)
    print('status code: ', r.status_code)
    response_dict = r.json()
    return response_dict


<mask token>

<mask token>


def find_language(language):
    url = 'https://api.github.com/search/repositories?q=language:'
    url += language + '&sort=stars'
    r = requests.get(url)
    print('status code: ', r.status_code)
    response_dict = r.json()
    return response_dict


<mask token>
for v in program_language:
    language_dict = find_language(v)
    program_language_num.append(int(language_dict['total_count']))
<mask token>
hist.add('仓库数量', program_language_num)
hist.render_to_file('language_num.svg')

<mask token>


def find_language(language):
    url = 'https://api.github.com/search/repositories?q=language:'
    url += language + '&sort=stars'
    r = requests.get(url)
    print('status code: ', r.status_code)
    response_dict = r.json()
    return response_dict


program_language = ['Golang', 'c++', 'php', 'java', 'python', 'JavaScript',
    'r', 'c#', 'Swift', 'ObjectiveC']
program_language_num = []
for v in program_language:
    language_dict = find_language(v)
    program_language_num.append(int(language_dict['total_count']))
hist = pygal.Bar()
hist.title = 'github编程语言仓库数量'
hist.x_labels = program_language
hist.x_title = 'language'
hist.y_title = 'number'
hist.add('仓库数量', program_language_num)
hist.render_to_file('language_num.svg')

import requests
import pygal
<mask token>


def find_language(language):
    url = 'https://api.github.com/search/repositories?q=language:'
    url += language + '&sort=stars'
    r = requests.get(url)
    print('status code: ', r.status_code)
    response_dict = r.json()
    return response_dict


program_language = ['Golang', 'c++', 'php', 'java', 'python', 'JavaScript',
    'r', 'c#', 'Swift', 'ObjectiveC']
program_language_num = []
for v in program_language:
    language_dict = find_language(v)
    program_language_num.append(int(language_dict['total_count']))
hist = pygal.Bar()
hist.title = 'github编程语言仓库数量'
hist.x_labels = program_language
hist.x_title = 'language'
hist.y_title = 'number'
hist.add('仓库数量', program_language_num)
hist.render_to_file('language_num.svg')

import requests
import pygal
"""
 检查各种语言的仓库
"""
def find_language(language):
	url="https://api.github.com/search/repositories?q=language:"
	url+=language+"&sort=stars"
	r=requests.get(url)
	print("status code: ",r.status_code)
	#将api响应存储在一个变量中,转化为python字典
	response_dict=r.json()
	return response_dict
program_language=['Golang','c++','php','java','python','JavaScript'
			,'r','c#','Swift','ObjectiveC']

program_language_num=[]			
for v in program_language:
	language_dict=find_language(v)
	program_language_num.append(int(language_dict['total_count']))
#可视化数据
hist=pygal.Bar()
hist.title="github编程语言仓库数量"
hist.x_labels=program_language
hist.x_title="language"
hist.y_title="number"

hist.add('仓库数量',program_language_num)
hist.render_to_file('language_num.svg')
	

	
