PyPI Package Stats Action

Featured

Fetch PyPI package download statistics and metadata in GitHub Actions

Gallery image 1

PyPI stats inside GitHub Actions: outputs, JSON file, and job summary

When it’s useful

Your team already runs workflows for releases, docs, or reporting. Pulling download totals and package metadata in the same job avoids copy-pasting from external dashboards and keeps numbers versioned with the pipeline that cares about them.

What you can do

  • Pass a package name; the step calls through to the pypi-package-stats library for a single consolidated fetch.
  • Expose step outputs (a full JSON string, name, version, and last day / week / month download fields) when you assign an id to the step.
  • Write the same payload to a JSON file (default stats.json, path configurable) for artifacts or downstream scripts.
  • Rely on an automatic Markdown table on the workflow run Summary tab for quick human reads.

Limits and fit

Figures inherit pypistats freshness and breakdown rules (see the library docs). The action fails with a clear message when the package is missing, the upstream API errors, or the output path cannot be written. Inputs, outputs, and example workflows are documented in the repository and on the GitHub Marketplace.