Skip to content

Commit 430bab9

Browse files
committed
Update fetch_members.py
1 parent 065ad9c commit 430bab9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/fetch_members/fetch_members.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ def collect_contributors_from_repos(org_name):
377377
contributors_data[username] = {
378378
'repos': [],
379379
'total_contributions': 0,
380+
'repo_contributions': {},
380381
'user_info': {
381382
'html_url': contributor['html_url'],
382383
'avatar_url': contributor['avatar_url']
@@ -385,6 +386,7 @@ def collect_contributors_from_repos(org_name):
385386

386387
contributors_data[username]['repos'].append(repo_name)
387388
contributors_data[username]['total_contributions'] += contributions
389+
contributors_data[username]['repo_contributions'][repo_name] = contributions
388390

389391
# API 速率限制控制
390392
delay = 0.1 if CONFIG['GITHUB_TOKEN'] else 0.5
@@ -717,6 +719,7 @@ def save_to_json(members, output_file):
717719
'org_total_forks': member.get('org_total_forks', 0),
718720
'org_total_contributions': member.get('org_total_contributions', 0),
719721
'org_avg_stars_per_repo': round(member.get('org_avg_stars_per_repo', 0), 2),
722+
'repo_contributions': member.get('repo_contributions', {}),
720723
# 其他信息
721724
'avatar': clean_csv_field(member.get('avatar', '')),
722725
'bio': clean_csv_field(member.get('bio', '')),
@@ -849,6 +852,7 @@ def main():
849852
'org_total_forks': org_stats['org_total_forks'], # 参与的组织仓库总 forks
850853
'org_total_contributions': org_stats['org_total_contributions'], # 在组织中的总贡献数
851854
'org_avg_stars_per_repo': org_stats['org_avg_stars_per_repo'], # 平均每个参与仓库的 stars
855+
'repo_contributions': contrib_info.get('repo_contributions', {}), # 每个仓库的贡献数
852856
# 其他信息
853857
'avatar': local_avatar, # 本地头像路径
854858
'bio': user_details.get('bio') if user_details else '',

0 commit comments

Comments
 (0)