PyPi download statistics for several packages or for all packages from a user
pip install pipuserstats
Retrieves download statistics for a given user or package(s) from PyPI Stats API.
Args:
username_or_packages (str | tuple | list): The username or package(s) to retrieve statistics for.
If a string is passed, username_or_packages will be treated as a username. If a list/tuple is passed,
username_or_packages will be treated as packages.
sleeptime (float | int, optional): The time to sleep between API requests. Defaults to 1.0.
clear_cache (bool, optional): Whether to clear the PyPI Stats API cache before retrieving statistics.
Defaults to False.
Returns:
pd.DataFrame: A pandas DataFrame containing the download statistics for the given user or package(s).
Raises:
Exception: If an error occurs while retrieving statistics for a package.
from pipuserstats import get_user_pip_stats
df = get_user_pip_stats(
username_or_packages="hansalemao", sleeptime=1, clear_cache=False
)
print(df)
"""
# -1 means "no data available"
total 2023-04-20 ... 2022-10-23 2022-10-22
a-cv-imwrite-imread-plus 3593 31 ... -1 -1
a-cv-sift-detection 244 -1 ... -1 -1
a-cv2-calculate-difference 279 2 ... -1 -1
a-cv2-calculate-simlilarity 339 2 ... -1 -1
a-cv2-easy-resize 2223 24 ... -1 -1
... ... ... ... ...
"""
df = get_user_pip_stats(
username_or_packages=["pandas", "numpy"], sleeptime=0.5, clear_cache=False
)
"""
df
Out[4]:
total 2023-04-20 2023-04-19 ... 2022-10-24 2022-10-23 2022-10-22
pandas 639313100 4258267 4265098 ... 3721798 2540678 2738365
numpy 843036266 5667169 5747109 ... 4882242 3261557 3556995
[2 rows x 181 columns]
"""
"""
Metadata
Release files for pipuserstats 0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pipuserstats-0.10.tar.gz | 9.4 kB | Without provenance | Details for pipuserstats-0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pipuserstats-0.10-py3-none-any.whl | Python 3 | none | any | Details for pipuserstats-0.10-py3-none-any.whl |
Total release size: 21.2 kB
Release files / pipuserstats-0.10.tar.gz
| Download URL | pipuserstats-0.10.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb49cef2d3bc7008a22058b70c701904c1836c1d7847af66dfd0fc29f1967948
|
|
BLAKE2b-256 checksum How to use checksums |
7512122b85f568b1e933df30ccda402ae995dddf72572d3b0a83a8acdaf1bf31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / pipuserstats-0.10-py3-none-any.whl
| Download URL | pipuserstats-0.10-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80ca8456cd3ba1d9ccd4b12c249ecde2e0ca834d65a3dcf953ea76e1e9e3a0d9
|
|
BLAKE2b-256 checksum How to use checksums |
7e97741ba2366e70c594c2c27850c83a8160d4abed92badc9ed5368f796a1372
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for pipuserstats 0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.