Python interface to the PyPI Stats API (https://pypistats.org/api). Provides programmatic and CLI access to download statistics for Python packages. Current version 1.13.0, requires Python >=3.10. Releases approximately every few months.
pip install pypistatsVerified import paths — ran on the pinned version, not inferred.
Fetches recent download stats for a package in JSON format.
Upgrade to Python 3.10+ or pin pypistats<1.12.0.
Use only the public API; do not depend on httpx-related behavior.
Specify format='json' or other explicit format.
Ensure you pass a string package name to the Python functions.
If parsing output, update your regex or use format='json'.
Use `from pypistats import recent` or `import pypistats; pypistats.recent(...)`.
Explicitly `import pypistats.recent` (though `from pypistats import recent` is cleaner).
Use one of the accepted formats: format='json' (or 'csv', 'markdown', None).