Skip to main content

Harvest add-on metadata from PyPI (by trove classifier) and npm into a normalised JSON snapshot — ships with a Plone/Volto profile.

Project description

addon-harvester

Harvests add-on/package metadata from PyPI (any trove classifier) and npm (search queries) into one normalised JSON snapshot (index.json, schema_version 3) with a 0–100 health score per add-on. Std-lib only, no framework dependency. PyPI is enumerated via the public BigQuery dataset (the only non-deprecated bulk API); XML-RPC browse and the Simple index remain as fallbacks.

The search terms live in harvest.toml — point them at any ecosystem ("Framework :: Django", "Framework :: Zope", ...). The shipped default is the Plone profile: Framework :: Plone plus Volto/Aurora npm queries, with Plone-specific enrichments (version compat, add-on categories, backend/frontend pairing) that simply stay empty for other ecosystems.

Docker (production, refresh every 4 h)

1. .env in the repo root:

BIGQUERY_PROJECT=my-gcp-project
GITHUB_TOKEN=ghp_...        # optional: GitHub stars/last-commit enrichment

2. GCP service-account key at secrets/gcp-key.json (one-time):

gcloud iam service-accounts create harvester --project=$PROJECT
gcloud projects add-iam-policy-binding $PROJECT \
    --member="serviceAccount:harvester@$PROJECT.iam.gserviceaccount.com" \
    --role=roles/bigquery.jobUser
gcloud iam service-accounts keys create secrets/gcp-key.json \
    --iam-account=harvester@$PROJECT.iam.gserviceaccount.com

3. Run:

docker compose up -d --build
docker compose logs -f harvester

The container harvests once at startup, then every 4 hours (docker/crontab), writing to ./data/index.json. Harvest flags live in HARVEST_ARGS in docker-compose.yml. Without a key file the harvester falls back to the deprecated XML-RPC API.

Local development

make install        # venv + package + dev extras (Python ≥ 3.14)
make test           # pytest — offline, all network mocked
make lint           # ruff
make harvest        # full run (ARGS="--limit 20" to override)

For BigQuery enumeration locally, log in once with gcloud auth login and set BIGQUERY_PROJECT in .env — tokens are minted automatically per run.

As a library (no I/O, snapshot returned in memory):

from addon_harvester import Harvester, HarvestOptions, write_snapshot

snapshot = Harvester(HarvestOptions(limit=20)).run()
write_snapshot(snapshot, "index.json")

Configuration

Where What
harvest.toml search terms: PyPI trove classifiers + npm search queries (--classifier overrides the classifiers, --config for another file)
.env BIGQUERY_PROJECT, GITHUB_TOKEN/GH_TOKEN, optional BIGQUERY_TOKEN
python main.py --help all CLI flags (sources, limit, workers, output, ...)

Every CLI run writes its full log to var/log/harvest-<timestamp>.log (newest 20 kept); -v only controls console verbosity.

Architecture

src/addon_harvester/
├── harvester.py    orchestration → snapshot (no I/O)
├── sources/        pypi (BigQuery → XML-RPC → Simple), npm, github enricher, bigquery client
├── normalizers/    raw registry document → TAddon
├── healthscore/    health score (rubric: healthscore/config.py)
└── http.py         retrying JSON client with per-thread keep-alive · config.py · types.py

Each source implements list_packages / fetch_package / fetch_downloads / normalize; HarvestBase.harvest() drives them identically. main.py is the CLI wrapper, Makefile the task runner.

Release

make build          # sdist + wheel into dist/
make publish        # upload to PyPI (needs credentials)

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

addon_harvester-1.0.1.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

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

addon_harvester-1.0.1-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file addon_harvester-1.0.1.tar.gz.

File metadata

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

File hashes

Hashes for addon_harvester-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f0d7bf19d628eded396e053dc45b429b220b22ed04e23e14940ee91634f55767
MD5 301350d326a965eace84b3a4ee3c1640
BLAKE2b-256 38195e0428b1236159535ba09c9545e119588c679b681d48a48edda6a5909d40

See more details on using hashes here.

Provenance

The following attestation bundles were made for addon_harvester-1.0.1.tar.gz:

Publisher: release.yml on interaktivgmbh/addon-harvester

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

File details

Details for the file addon_harvester-1.0.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for addon_harvester-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a00f6d2114d33e1eb839c3896e0938bc831746b5b81dd5c13b0eabf3c0f7968c
MD5 1c985bac95a3501276d4e47a03d5aa9b
BLAKE2b-256 7849981c304a8cec87cd396249c9502222d46a9386403ffca0b92b32014bffc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for addon_harvester-1.0.1-py3-none-any.whl:

Publisher: release.yml on interaktivgmbh/addon-harvester

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