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.

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

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 and site/summary.json
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.
  • 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; pkgreach reuses its storage layer.

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.2

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.2
File Size Uploaded Provenance Actions
pkgreach-0.0.2.tar.gz 35.4 kB Without provenance Details for pkgreach-0.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 73.7 kB

Release files / pkgreach-0.0.2.tar.gz

Download URL pkgreach-0.0.2.tar.gz
Size 35.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ada7c17ba6eb9a9a343aa50b128ce98c6ceeb7a445e537898c2f4ffb66db19c4
BLAKE2b-256 checksum
How to use checksums
be42a1db2ab5588c7981603a5134fa1bb02dc9a73a11e5e66d969d1f840bc954
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.2-py3-none-any.whl

Download URL pkgreach-0.0.2-py3-none-any.whl
Size 38.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99389d7c2464a82f3d6e74fbce9f1f17816306e5c29cd5546e3ad16b75769c1d
BLAKE2b-256 checksum
How to use checksums
ce9725a590ce2da463f8989eccb6b325329359e234143edb2b3c08de0a48697c
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.2

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