Skip to main content

A zero-dependency CLI tool to track and visualize PyPI package download trends.

Project description

pptrend

PyPI version License: MIT

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 install required 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, pptrend stores 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pptrend-0.1.2.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pptrend-0.1.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file pptrend-0.1.2.tar.gz.

File metadata

  • Download URL: pptrend-0.1.2.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pptrend-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a3a0d245b78dcff949a742607ce90e61532945800509ba7daad9dae068417cb4
MD5 c29526949d18f5457e0824095799c8e9
BLAKE2b-256 f95d98c9ca9d81553ca7356bd27338adcc7bf3fe568e40a4b71a368d2deeba2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pptrend-0.1.2.tar.gz:

Publisher: publish.yml on cphotor/pptrend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pptrend-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pptrend-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pptrend-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 93561d42e2370a8b9fbb606585a0432336b65a2ddf72cd6a593f235b3bf5eb69
MD5 119b86e59878d86423cfa08ce3314829
BLAKE2b-256 2d637680ffcb62a25b27d59102dd6fcf52b4d84493d72e91b2cdc86acd168acb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pptrend-0.1.2-py3-none-any.whl:

Publisher: publish.yml on cphotor/pptrend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page