通过Github API列出Github存储库的依赖项

11

2
我认为目前还不可能,参见这篇帖子 - Bertrand Martel
似乎无法通过API实现,但可以通过CLI实现:https://pypi.org/project/github-dependents-info/ - Nicolas Vuillamy
1个回答

2

当然,您可以安装github-dependents-info并像其他API一样在您的Python脚本中使用它。

例如,下面的脚本:

from github_dependents_info.gh_dependents_info import GithubDependentsInfo
import json

gh_deps_info = GithubDependentsInfo(
            'aimhubio/aim',
            debug=False,
            sort_key='name',
            min_stars=0,
            json_output=True,
            badge_markdown_file=False,
            badge_color='informational',
            merge_packages=True,
        )

dependents = gh_deps_info.collect()
with open('aim_dependents.json', 'w') as f:
    json.dump(dependents, f, indent=4)

等同于CLI命令:
github-dependents-info --repo aimhubio/aim -p -j >"aim_dependents.json"

试一下,给我一个赞吧!

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接