How can we know a Python script's dependencies recursively, entirely ie. of any kind of subroutines including of Python itself?
Knowledge on Python script's dependencies
Knowledge on Python script's dependencies
|
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 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: To get the full list, follow the tree as each dependency may also have it's own dependencies.
|
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
What is the Basic Knowledge Required To Understand Python? | haimen | 11 | 8,399 |
Apr-30-2021, 11:54 AM Last Post: AnupriyaSingh |
|
Looking for a book to deepen my Python knowledge. | SpongeB0B | 2 | 3,258 |
Jun-25-2020, 03:06 PM Last Post: snippsat |
|
latest astroid dependencies break mypy | astir13 | 2 | 3,028 |
Feb-28-2019, 02:14 PM Last Post: astir13 |
Users browsing this thread: 1 Guest(s)