“1d4f02ccd9fe9bb60b2ca3f13bd51134c84580d8”上不存在“doc/design/git@gitcode.net:s920243400/PaddleDetection.git”
提交 1e93b039 编写于 作者: F feilong

refactor data dir

上级 6f0bde03
...@@ -23,7 +23,7 @@ config = { ...@@ -23,7 +23,7 @@ config = {
}, },
"schema": { "schema": {
"repo_github_user_info": { "repo_github_user_info": {
"file": "../GitHub/Userinfo.xlsx", "file": "../data/GitHub/Userinfo.xlsx",
"sheet_name": "repo", "sheet_name": "repo",
"desc": "开源项目Github贡献者信息", "desc": "开源项目Github贡献者信息",
"fields": [ "fields": [
...@@ -100,7 +100,7 @@ config = { ...@@ -100,7 +100,7 @@ config = {
] ]
}, },
"repo_github_info": { "repo_github_info": {
"file": "../Github-Repos.xlsx", "file": "../data/Github-Repos.xlsx",
"sheet_name": "汇总", "sheet_name": "汇总",
"desc": "开源项目在Github上的项目交互数据", "desc": "开源项目在Github上的项目交互数据",
"fields": [ "fields": [
...@@ -162,7 +162,7 @@ config = { ...@@ -162,7 +162,7 @@ config = {
] ]
}, },
"repo_csdn_trends": { "repo_csdn_trends": {
"file": "../CSDN/repo-csdn-trends.xlsx", "file": "../data/CSDN/repo-csdn-trends.xlsx",
"sheet_name": "Sheet1", "sheet_name": "Sheet1",
"desc": "开源项目在CSDN站内指数数据", "desc": "开源项目在CSDN站内指数数据",
"fields": [ "fields": [
...@@ -179,7 +179,7 @@ config = { ...@@ -179,7 +179,7 @@ config = {
] ]
}, },
"repo_commit_rank": { "repo_commit_rank": {
"file": "../CSDN/repo-commit-rank.csv", "file": "../data/CSDN/repo-commit-rank.csv",
"desc": "开源项目在Github的月commit变化", "desc": "开源项目在Github的月commit变化",
"fields": [ "fields": [
{ {
...@@ -205,7 +205,7 @@ config = { ...@@ -205,7 +205,7 @@ config = {
] ]
}, },
"repo_github_active_trends": { "repo_github_active_trends": {
"file": "../PingCAP/项目活跃度变化.csv", "file": "../data/PingCAP/项目活跃度变化.csv",
"desc": "开源项目在Github上的月活跃度数据", "desc": "开源项目在Github上的月活跃度数据",
"fields": [ "fields": [
{ {
...@@ -241,7 +241,7 @@ config = { ...@@ -241,7 +241,7 @@ config = {
] ]
}, },
"repo_github_popular_trends": { "repo_github_popular_trends": {
"file": "../PingCAP/项目受欢迎度变化.csv", "file": "../data/PingCAP/项目受欢迎度变化.csv",
"desc": "开源项目在Github上的月收欢迎程度数据", "desc": "开源项目在Github上的月收欢迎程度数据",
"fields": [ "fields": [
{ {
......
...@@ -6,10 +6,10 @@ import time ...@@ -6,10 +6,10 @@ import time
import re import re
# 读取json文件 # 读取json文件
with open("dataset/repo-list.json", 'r') as f: with open("../data/dataset/repo-list.json", 'r') as f:
data = json.load(f) data = json.load(f)
with open('dataset/result.txt', 'r+') as file: with open('../data/dataset/result.txt', 'r+') as file:
file.truncate(0) file.truncate(0)
for list_item in data: for list_item in data:
...@@ -19,7 +19,7 @@ for list_item in data: ...@@ -19,7 +19,7 @@ for list_item in data:
url = "https://api.github.com/repos/" + a url = "https://api.github.com/repos/" + a
# url2 = "https://api.github.com/repos/" + a + "/contributors?per_page=1&anon=true" # url2 = "https://api.github.com/repos/" + a + "/contributors?per_page=1&anon=true"
payload={} payload = {}
headers = { headers = {
'Authorization': '' # 这里填入你自己的 GitHub Personal Access Token 'Authorization': '' # 这里填入你自己的 GitHub Personal Access Token
} }
...@@ -38,6 +38,7 @@ for list_item in data: ...@@ -38,6 +38,7 @@ for list_item in data:
# time.sleep(4) # Sleep for 2 seconds # time.sleep(4) # Sleep for 2 seconds
# print(str(response.json()["id"])+ ',' + response.json()["owner"]["login"] + ',' + response.json()["full_name"] + ',' + str(response.json()["stargazers_count"]) + ',' + str(response.json()["forks_count"]) + ',' + str(response.json()["open_issues"])) # print(str(response.json()["id"])+ ',' + response.json()["owner"]["login"] + ',' + response.json()["full_name"] + ',' + str(response.json()["stargazers_count"]) + ',' + str(response.json()["forks_count"]) + ',' + str(response.json()["open_issues"]))
with open('dataset/result.txt', 'a') as f: with open('../data/dataset/result.txt', 'a') as f:
f.write(str(response.json()["id"])+ ',' + response.json()["owner"]["login"] + ',' + response.json()["full_name"] + ',' + str(response.json()["stargazers_count"]) + ',' + str(response.json()["forks_count"]) + "\n") f.write(str(response.json()["id"]) + ',' + response.json()["owner"]["login"] + ',' + response.json()[
"full_name"] + ',' + str(response.json()["stargazers_count"]) + ',' + str(response.json()["forks_count"]) + "\n")
time.sleep(2) # Sleep for 2 seconds time.sleep(2) # Sleep for 2 seconds
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册