我正在使用PyGithub開發一個帶有 networkx 的專案,該專案創建圖表,將某些 repos 中的所有貢獻者用作節點。但是,我無法使用該庫從存盤庫中獲取提交者。有沒有辦法讓提交者?非常感謝幫助
我擁有的代碼:
from github import Github
import networkx as nx
def make_graph(commiters):
G = nx.complete_graph(commiters)
return G
def merge_graphs(G1, G2):
G = nx.complete_graph(G1.nodes() G2.nodes())
token = (token)
g = Github(token)
for repo in g.get_user('user').get_repos():
print(repo.name)
repo.edit(has_wiki=False)
uj5u.com熱心網友回復:
根據PyGithub 檔案,您需要使用get_contributors方法:
repo.get_contributors()
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/449507.html
上一篇:如何過濾這個資料框?
