2

I have been looking for a package/api-url or something similar to get a list of (possibly) all modules available for python(2,3) and their licenses.

I used to work with js where you can easily api call npm infos for js for informations as json about the module argparse (versions and for each version a license).

I couldn't find something similar for python. Just pypi infos for python which is a html response. I also found packages like yolk or pkg_ressources which list all the modules (+ licenses) installed with pip. They wont display modules which are not installed yet.

Is there a solution which either lists all available modules + licenses or a simple url where I can api call and get a json(or similar format) response?

Edit: So this question is similar, but does not fully answers my questions. I have already checked all answers of it (namely pkg_ressources, yolk, pip-licenses, Python Package License Checker). They all work fine for INSTALLED packages. But I want a solution for EVERY AVAILABLE package, like npm for js. I do not want to install every single package to get the informations about it.

fräfrö
  • 71
  • 1
  • 5
  • `pip` can install packages from private or nonstandard repositories. (`npm` can too, for that matter.) There is no well-defined list of "all available packages" anywhere. Are you asking how to fetch metadata for all packages from pypi.org? What exactly are you trying to do with this information? – Daniel Pryden Nov 13 '18 at 12:39
  • @Daniel _Are you asking how to fetch metadata for all packages from pypi.org_. Yes I am. _What exactly are you trying to do with this information?_ Lets say I get a pyproject.toml and read the dependencies from it. I can get a dependency tree from the given dependencies.
    Now to get the licenses for theses dependencies I don't want to install every single dep.
    – fräfrö Nov 13 '18 at 14:24
  • Ideal would be something like a update stream of the modules like in npm(https://github.com/npm/registry/blob/master/docs/follower.md). I could just follow this stream and have all the licenses and dependencies saved in my DB. – fräfrö Nov 13 '18 at 14:49
  • 1
    You might be interested in [bandersnatch](https://github.com/pypa/bandersnatch) – wim Nov 13 '18 at 17:18

0 Answers0