Anyway to resolve package dependencies without installation or download?

I’m working on a project in which I want to visualize dependencies relationship among all packages on PyPI.

The json api contains so many missing values that it seems I have to install or download these packages and use some package management tools to get dependency information, which will take too much time.

So is there a way to make this thing esaier, or with lower overhead? I have explored but found no answer. There are not so many cases when you only want dependency list and not the package, after all.

This is my first question here. Looking forward to help and suggestion. Thank you.

1 Like

Actually there are. But for many distributions found on PyPI, it is impossible to know the dependencies unless the distribution is actually fetched and built. That is one of the slow downs for dependency resolution nowadays.

In general, there are quite some tools and libraries that deal with this. Apart from the obvious ones like all the installers (such as pip, poetry, etc.), the one I can think of as the closest to what you seem to be trying to do here might be @wim’s tool (as far as I understood), maybe it can also be used as a library somehow:

I also remember seeing some kind of a graph of dependencies across the whole PyPI repository, but can’t find it right now.

1 Like

libraries.io has this information already harvested, so you don’t have to do that.

1 Like

As far as I can tell (checked a couple of projects of mine), the info delivered by this service does not seem entirely accurate. But I guess it can be a good start, depending on what the end goal is. They also seem to offer an API (JSON over HTTP).

2 Likes

A reference text on the topic: