Skip to main content

pkgreach

How are your packages really used? pkgreach tracks your packages on PyPI, npm, crates.io and GitHub every week, keeps the history the registries throw away, and publishes a report that separates robots from people.

Live example (the author's packages): https://thorwhalen.github.io/pkgreach/

Why

Registries keep a few months of daily download counts (crates.io 90 days, PyPI about 6 months, npm 18 months), and none of them separates people from robots: mirrors, CI pipelines and scanners download every release of every package. So pkgreach reports downloads against a noise floor (what your least-used packages get), next to the signals a robot does not create: dependents (packages and repositories that declare yours, from ecosyste.ms), and stars and forks of your public repositories. Growth is shown against the platform's median package (when robot traffic doubles across a registry, every package doubles), and a package that was in the noise last month is marked low base rather than given a +900%.

Quick start: a weekly GitHub Action

In any repository you own (it can be public: everything collected is public already):

pip install pkgreach
pkgreach init . --pypi YOUR_PYPI_USER --npm YOUR_NPM_USER --github YOUR_GITHUB_USER YOUR_ORG
git add -A && git commit -m "pkgreach" && git push

pkgreach init writes pkgreach.toml (what to follow) and .github/workflows/pkgreach.yml. Then turn on Pages once (Settings → Pages → Source: GitHub Actions) and run the workflow (gh workflow run pkgreach.yml). Every Sunday after that it collects, commits the history to the pkgreach-data branch, and publishes the report on your GitHub Pages. No secret is needed.

The workflow is three steps:

- uses: actions/checkout@v4
- uses: thorwhalen/pkgreach@<version>   # pin the release you installed
  id: reach
- uses: actions/upload-pages-artifact@v3
  with:
    path: ${{ steps.reach.outputs.site-dir }}
- uses: actions/deploy-pages@v4

The action's inputs (all optional): config, data-branch, site-dir, title, default-view (the view the page opens on: overview, a platform such as pypi, all, projects or movers), token, commit, fail-on-errors; see action.yml.

Configuration

pkgreach.toml has one table per platform: pypi, npm, crates, github. Every key is optional; unknown keys are refused, so a typo never silently does nothing.

[pypi]
users = ["alice"]                    # every package these accounts own or maintain
packages = ["a-package-of-a-friend"] # plus these
exclude = ["alice-test-*"]           # minus these (glob patterns)

[npm]
users = ["alice"]

[crates]
users = ["alice"]                    # crates.io login

[github]
users = ["alice", "alice-org"]       # public repos of these users and orgs
where = { fork = false, archived = false }   # characteristics a package must have

where matches the metadata of listed packages field by field (GitHub repos have fork, archived, language; PyPI packages have role, owner or maintainer); packages named in packages are always kept. PyPI names are normalized (Flask_Login is flask-login). Top-level keys: max_workers (default 4) and dependents (default true: ask ecosyste.ms).

The Action's inputs: config, data-branch (default pkgreach-data), site-dir, title, token (reads GitHub; defaults to the workflow's token), commit, fail-on-errors (default false: a failed package is listed in last_run.json and flagged on the page, and the run stays green).

Run it locally

pkgreach collect --config pkgreach.toml   # into ~/.local/share/pkgreach/data
pkgreach report --out site                # site/index.html, summary.json, last_run.json
pkgreach report --out site --default-view pypi   # open on the PyPI tab
pkgreach init . --pypi me --github me my-org   # a config and a weekly workflow

From Python, every part is a keyword argument with a working default:

from pkgreach import collect, load_settings, build_site, Files, PLATFORMS

collect(load_settings("pkgreach.toml"), store=Files("data"))
build_site(Files("data"), Files("site"))
  • collect(platforms=...) and summarize(platforms=...): add a platform with Platform(name, list_packages, fetch, kind=..., headline=...); see pkgreach/platforms/__init__.py for the contract. A "snapshot" platform (current values only, like Hugging Face likes) is shown by its headline metrics.
  • collect(select=lambda platform, record: ...): any selection a TOML file cannot express.
  • collect(dependents=...): another source of dependents.
  • build_site(analyze=...): your own summary; summary.json is the default one, for any other tool.
  • build_site(render=...): your own page from the same summary: any render(summary, *, title, default_view) returning the HTML (or a mapping of file names to contents, for several pages). The default, render_page, is one page with views you switch in place: Overview (platform cards, most used, movers, most depended on), one tab per platform (search, sort, noise hidden), All (every table, full length; also what a browser without JavaScript shows), Projects (packages joined to their repository) and Movers. default_view= (CLI --default-view, Action input default-view) picks the one the page opens on; every view has its own link (#tab=pypi&sort=-chg).
  • make_http(headers_by_host=...): credentials per host (the CLI gives GitHub GITHUB_TOKEN or GH_TOKEN).
  • store= / out=: any MutableMapping[str, str], such as a dol store (S3, a database).

What is collected

platform daily downloads other numbers source
PyPI all, and without mirrors versions, dependents pypistats.org, PyPI JSON, ecosyste.ms
npm all dependents api.npmjs.org, ecosyste.ms
crates.io all total downloads, versions, dependents crates.io, ecosyste.ms
GitHub none stars, forks, open issues and PRs GitHub REST (public repos only)

The history is plain CSV, one table per kind, split by year (downloads/YYYY.csv, metrics.csv, packages.csv, runs.csv), merged idempotently so re-running a collection never changes the result. manifest.json lists every file and its columns. Design and alternatives: docs/adr/0001-seams-and-scope.md. What each platform offers, verified: docs/research/platform-apis.md.

GitHub traffic (views, clones, referrers) is private and needs a token with push access. That is ghtraffic's job, in a private repository; both keep their history with csvledger.

Dependents data is from ecosyste.ms, licensed CC BY-SA 4.0; the report credits it and the history carries a DATA-LICENSE.md. A repository that stops being listed (made private, deleted, or dropped from the selection) leaves the current tables at the next run; what was committed before stays in the branch's git history.

Limits

  • History starts at your first run, minus what the registry still keeps.
  • One run of about 400 packages takes about 7 minutes, mostly waiting on pypistats.org's limit of 60 requests a minute.
  • Listing a PyPI account uses PyPI's XML-RPC user_packages, deprecated but still answered.
  • Dependents come from ecosyste.ms, which indexes new packages with some delay: a fresh package shows none at first.

Metadata

Release files for pkgreach 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pkgreach 0.0.5
File Size Uploaded Provenance Actions
pkgreach-0.0.5.tar.gz 51.7 kB Without provenance Details for pkgreach-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pkgreach 0.0.5
File Interpreter ABI Platform Actions
pkgreach-0.0.5-py3-none-any.whl Python 3 none any Details for pkgreach-0.0.5-py3-none-any.whl

Total release size: 107.9 kB

Release files / pkgreach-0.0.5.tar.gz

Download URL pkgreach-0.0.5.tar.gz
Size 51.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b206c4d7dc0bc0a148f6fdcea4ae68795c6564b0b7f5443b63813c9927533250
BLAKE2b-256 checksum
How to use checksums
3292fe900d7db16ed299c750ae97f99ce24ff13ef5f7faa4f0a3f53fb9fd65d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pkgreach-0.0.5-py3-none-any.whl

Download URL pkgreach-0.0.5-py3-none-any.whl
Size 56.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30eb791832190d860ead373634386c412f281b671f6443f8b69a74dcf4c17d28
BLAKE2b-256 checksum
How to use checksums
0753dce4ff10545282258eb0b348addae927cedee6485e565e34de6db9cfa77b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pkgreach 0.0.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page