A zero-dependency CLI tool to track and visualize PyPI package download trends.
Project description
pptrend
A zero-dependency command-line tool to track and visualize PyPI package download trends directly in your terminal.
โจ Features
- Zero Dependencies: Built entirely with Python standard libraries. No
pip installrequired for dependencies. - Adaptive ASCII Charts: Automatically adjusts the chart granularity (daily, weekly, monthly, or yearly) based on the data range.
- Smart Caching: Stores data locally to minimize API calls. Skips network requests if data is recent.
- Cross-Platform: Works on macOS, Linux, and Windows.
๐ก Data Source & Limitations
- Primary Source: PePy.tech API.
- Fallback Source: PyPIStats.org API (used if PePy is unavailable).
- Data Range: APIs provide statistics for the last 180 days. However,
pptrendstores data locally, allowing you to build a historical record that extends far beyond 180 days by running the tool periodically. - Data Continuity: If a package hasn't been updated in the database for more than 180 days, its historical data is considered "disconnected" and can no longer be extended.
- Accuracy: Download counts are aggregated from PyPI statistics. Note that these figures may include automated systems (like CI/CD pipelines) and might not represent unique human users.
๐ Installation
Option 1: Using uv (Recommended)
First, install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
Then, choose one of the following ways to run pptrend:
A. Run directly with uvx (No installation required):
uvx pptrend requests
B. Install permanently with uv tool:
uv tool install pptrend
pptrend requests
Option 2: Using pipx
pipx installs the tool in an isolated virtual environment, keeping your system clean.
pipx install pptrend
pptrend requests
Option 3: Manual Install
Download pptrend.py and run it directly:
./pptrend.py <package_name>
๐ Usage
Track the download history of any PyPI package:
pptrend requests
pptrend flask
pptrend numpy
Check version:
pptrend --version
Clean disconnected data: If a package hasn't been tracked for over 180 days, its history can no longer be extended. Use this command to automatically scan and remove such stale records for all packages:
pptrend --clean
๐ Example Output
requests - Week view (180 days of data)
======================================================================
10-13 โ โ 180.4M
10-20 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ 306.2M
...
04-06 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ 326.7M
======================================================================
Total records: 180 | Periods shown: 26 weeks
Min: 178,740,886 | Max: 326,665,297 | Avg: 247,929,848
โ๏ธ Data Storage
pptrend stores its database in the standard application data directory for your OS:
- macOS:
~/Library/Application Support/pptrend/pptrend.db - Linux:
~/.local/share/pptrend/pptrend.db - Windows:
%APPDATA%\pptrend\pptrend.db
๐ ๏ธ Development
To run the script from source using uv:
git clone https://github.com/cphotor/pptrend.git
cd pptrend
uv run pptrend.py requests
๐ License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pptrend-0.1.1.tar.gz.
File metadata
- Download URL: pptrend-0.1.1.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a0f7c90fee052753886a4b18de5bade48f669f6740f09aa56a28bebbcf3fe91
|
|
| MD5 |
8c74804839bc813a8e5ea8cdc5a5cf3f
|
|
| BLAKE2b-256 |
428939ed0920856d2cb1667d6cc7d194f13eea4c88df0a969885c45c26c78599
|
Provenance
The following attestation bundles were made for pptrend-0.1.1.tar.gz:
Publisher:
publish.yml on cphotor/pptrend
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pptrend-0.1.1.tar.gz -
Subject digest:
6a0f7c90fee052753886a4b18de5bade48f669f6740f09aa56a28bebbcf3fe91 - Sigstore transparency entry: 1284825931
- Sigstore integration time:
-
Permalink:
cphotor/pptrend@e1a0287745f0c4786e68e825d61c3003a4c6d324 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/cphotor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e1a0287745f0c4786e68e825d61c3003a4c6d324 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pptrend-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pptrend-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f455246d44127233a707e1a24e257cf65a67059ec27e297b2265ba9aad3a892
|
|
| MD5 |
e269815c8f109278872c35e3e11b8d1d
|
|
| BLAKE2b-256 |
cb84a0df78179eb333dc5828cef637cb6b4e199b034af885dd818c50156dec5d
|
Provenance
The following attestation bundles were made for pptrend-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on cphotor/pptrend
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pptrend-0.1.1-py3-none-any.whl -
Subject digest:
1f455246d44127233a707e1a24e257cf65a67059ec27e297b2265ba9aad3a892 - Sigstore transparency entry: 1284826023
- Sigstore integration time:
-
Permalink:
cphotor/pptrend@e1a0287745f0c4786e68e825d61c3003a4c6d324 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/cphotor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e1a0287745f0c4786e68e825d61c3003a4c6d324 -
Trigger Event:
push
-
Statement type: