Jun-02-2022, 01:33 AM
Jun-02-2022, 02:28 AM
you can get this from https://pypi.org/pypi/package/json (replace module with actual package name)
then use index ["info"]["requires_dist"] from your python script
or simply open url and search for "requires_dist"
you can also find required python version with ["info"]["requires_python"] or search "requires_python"
Edit 10:46 PM EDT
Here's a quick module that will get the info
then use index ["info"]["requires_dist"] from your python script
or simply open url and search for "requires_dist"
you can also find required python version with ["info"]["requires_python"] or search "requires_python"
Edit 10:46 PM EDT
Here's a quick module that will get the info
import requests import json from pathlib import Path import sys def get_dependencies(package_name): pkginfo = {} url = f"https://pypi.org/pypi/{package_name}/json" response = requests.get(url) if response.status_code == 200: pkginfo = json.loads(response.content) else: print(f"Unable to fetch url: {url}") sys.exit(-1) print(f"\nOther packages: {pkginfo['info']['requires_dist']}") print(f"python versions: {pkginfo['info']['requires_python']}") def main(): get_dependencies('pyflowchart') if __name__ == '__main__': main()results:
Output:Other packages: ['astunparse', 'chardet']
python versions: >=3.6
To get the full list, follow the tree as each dependency may also have it's own dependencies.