Looking for some PyPI query help

Martin v. Loewis martin at v.loewis.de
Wed Feb 23 08:21:50 CET 2011


Am 23.02.2011 07:53, schrieb Travis Griggs:
> Howdy Python brethren. I'm a Smalltalker, doing a bit of research on
> packaging ecospaces, in other languages and environments (I just
> finished examining Debian for example). I found what seems to be the
> big repository at PyPI.

Correct. There is a mailing list for it: catalog-sig at python.org.

> What would be enough for me, is to enumerate
> all of the packages there, and associate it with the number of
> prerequisite/dependent/imports it specifies. I don't need it to
> recurse thru dependents, just the immediate count.

Finding all the packages is easy:

http://pypi.python.org/simple/

Finding the respective dependencies is very very difficult.

You will need to download each package. If it is implemented using
setuptools, you can extract dependencies from the setup.py, looking
at setup_requires, install_requires, tests_require, extras_require.
If it is implemented using distutils, you need to read the documentation
to find out what the dependencies are, if any.

For many packages, it should be possible to find the corresponding
Debian or Redhat package, and correlate the dependency lists.

HTH,
Martin



More information about the Python-list mailing list