There is a JSON API for PyPI which allows getting data for packages:
http://pypi.python.org/pypi/<package_name>/json http://pypi.python.org/pypi/<package_name>/<version>/json
However, is it possible to get a list of all PyPI packages (or, for example, recent ones) with a GET call?
We're further increasing the security of the Python Package Index with another new beta feature: scoped API tokens for package upload.
As of 17 January 2022, more than 350,000 Python packages can be accessed through PyPI. PyPI primarily hosts Python packages in the form of archives called sdists (source distributions) or precompiled "wheels."
pip search Looking for a package, pip is there to help you out. pip search allows you to search PyPI for any package using the pip search <package> command. The result of the command returns the name and description of all the matching packages.
To make an API token: Verify your email address (check your account settings) In your account settings, go to the API tokens section and select "Add API token"
The easiest way to do this is to use the simple index at PyPI which lists all packages without overhead. You can then request the JSON of each package individually by performing a GET request to the URLs mentioned in your question.
I know that you asked for a way to do this from the JSON API, but you can use the XML-RPC api to get this info very easily, without having to parse HTML.
try: import xmlrpclib except ImportError: import xmlrpc.client as xmlrpclib client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi') # get a list of package names packages = client.list_packages()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With