Search code examples
pythondependenciespypi

Keep track of pypi dependencies - who is using my packages


Is there anyway through either pip or PyPi to identify which projects (published on Pypi) might be using my packages (also published on PyPi) - I would like to identify the user base for each package and possible attempt to actively engage with them.

Thanks in advance for any answers - even if what I am trying to do isn't possible.


Solution

  • This is not really possible. There is no easily accessible public dataset that lets you produce a dependency graph.

    At most you could scan all publicly available packages to parse their dependencies, but even then those dependencies are generated by running the setup.py script, so the dependencies can be set dynamically. It is quite common to adjust the dependencies based on the Python version (installing a backport of a standard-library dependency on older Python versions, for example). People have done this before but this is not an easy, lightweight task.

    Note that even then, you'll only find publicly declared dependencies. Any dependencies declared by private packages, not published to PyPI or another public repository, can't be accounted for.