The Github webpage shows on every repo's insights page what repos are dependent on it: https://github.com/django/django/network/dependents
Via the Github API you seem to only get the repos that your repo depends on not the repos that are dependent on your repo. See Repository.dependencyGraphManifests:
https://docs.github.com/en/graphql/reference/objects#repository
Did I miss something or is it just not possible to get the dependents via the API?
Sure, you can install github-dependents-info and use it in your Python script like other APIs.
For example, the following script:
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)
is equivalent to the CLI command:
github-dependents-info --repo aimhubio/aim -p -j > "aim_dependents.json"
Try it out and give me a like!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With