Skip to main content

stacpkg

Reproducible STAC packages for handoff, audit, verification, and relocation.

stacpkg turns selected STAC Items into a compact package that another environment can inspect, validate, share, and move. It is for the moment after a STAC search, when "these are the items" needs to become a durable artifact.

package = selected STAC Items + verifiable asset lock + optional content

The package keeps two required tables:

  • items.parquet: the selected STAC Items as a STAC GeoParquet-style table.
  • assets.lock.parquet: one row per locked STAC Asset, with structured location fields and observed object facts such as size, ETag, and last modified time when available.

With that lock in place, you can verify that referenced assets still match, relocate assets into controlled storage, enrich STAC metadata with alternate hrefs, and move the package through an OCI registry.

Install

pip install stacpkg

The quickstart below uses curl against a STAC API. stacpkg can start from STAC JSON, STAC NDJSON, or existing STAC GeoParquet.

Quickstart

Search the OpenAerialMap STAC API for two Austria Items and build a package:

tmpdir=$(mktemp -d "${TMPDIR:-/tmp}/stacpkg-openaerialmap-austria.XXXXXX")
bbox='16.415,47.1705,16.431,47.734'

curl -fsS https://api.imagery.hotosm.org/stac/search \
  --header "Accept: application/geo+json" \
  --header "Content-Type: application/json" \
  --data-binary "{
    \"collections\": [\"openaerialmap\"],
    \"bbox\": [$bbox],
    \"sortby\": [{\"field\": \"start_datetime\", \"direction\": \"asc\"}],
    \"limit\": 2
  }" \
  | stacpkg items from-json \
  | stacpkg build "$tmpdir/openaerialmap-austria.pkg"

echo "created $tmpdir/openaerialmap-austria.pkg"

This curl example keeps the request intentionally small and does not page through all matches. For larger catalogs, use a scalable STAC client such as rustac to stream newline-delimited STAC Items into stacpkg items from-ndjson.

Sample output:

created /tmp/stacpkg-openaerialmap-austria.ABC123/openaerialmap-austria.pkg

The package is just files on disk:

/tmp/stacpkg-openaerialmap-austria.ABC123/openaerialmap-austria.pkg/
  items.parquet
  assets.lock.parquet

Inspect it:

stacpkg inspect "$tmpdir/openaerialmap-austria.pkg" --format markdown

Sample output:

# stacpkg Inspect

- Package: `/tmp/stacpkg-openaerialmap-austria.ABC123/openaerialmap-austria.pkg`
- Items: 2
- Collections: openaerialmap
- Assets: 4
- Asset keys: thumbnail, visual
- Known asset bytes: 16750068

Verify Assets

Validate the package asset lock against the current live objects:

stacpkg asset-lock from-parquet "$tmpdir/openaerialmap-austria.pkg/assets.lock.parquet" \
  | stacpkg asset-lock validate

Sample output:

{"asset_key":"thumbnail","errors":[],"item_id":"631ee6653cdf1c0006b63c5b","store_type":"https","valid":true}
{"asset_key":"visual","errors":[],"item_id":"631ee6653cdf1c0006b63c5b","store_type":"https","valid":true}

Validation prints JSON lines and exits non-zero when an asset no longer matches the locked facts.

Relocate Assets

Copy locked assets into storage you control and write a new asset lock for the relocated locations:

mkdir -p "$tmpdir/local-assets"

stacpkg asset-lock from-parquet "$tmpdir/openaerialmap-austria.pkg/assets.lock.parquet" \
  | stacpkg asset-lock relocate \
      --source-prefix https://oin-hotosm-temp.s3.amazonaws.com/ \
      --store-type file \
      --key "$tmpdir/local-assets/" \
      --max-workers 4 \
      --memory-limit-bytes 512MiB \
      --chunk-size-bytes 8MiB \
  | stacpkg asset-lock to-parquet \
      "$tmpdir/openaerialmap-austria.local.assets.lock.parquet"

echo "created $tmpdir/openaerialmap-austria.local.assets.lock.parquet"

Sample output:

created /tmp/stacpkg-openaerialmap-austria.ABC123/openaerialmap-austria.local.assets.lock.parquet

Validate the relocated files the same way:

stacpkg asset-lock from-parquet "$tmpdir/openaerialmap-austria.local.assets.lock.parquet" \
  | stacpkg asset-lock validate

Common Flows

  • Start from a STAC API search, package selected Items, and keep the exact package inputs.
  • Verify remote assets before a run, handoff, or audit.
  • Relocate referenced assets into S3-compatible, local, or other object-store locations.
  • Enrich STAC Items with File Info and Alternate Assets fields from an asset lock.
  • Push and pull packages through OCI registries.

Docs

Development Commands

Use the repository Makefile as the source of truth for local quality gates:

  • make sync: install all dependency groups.
  • make pre-commit: run formatting, lint, and metadata checks.
  • make test-unit: run fast unit tests.
  • make test-integration: run optional local cross-tool integration tests.
  • make test-e2e: run the CI-sized kind/MinIO/registry e2e suite.
  • make test-e2e-full: run all e2e tests, including performance checks.
  • make test-all: run pre-commit, docs, unit, integration, and full e2e gates.

License

Apache 2.0 (Apache License Version 2.0, January 2004) https://www.apache.org/licenses/LICENSE-2.0

Metadata

Release files for stacpkg 0.1.4

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

Source distribution (sdist)

Source distribution for stacpkg 0.1.4
File Size Uploaded
stacpkg-0.1.4.tar.gz 37.4 kB Details

Built distribution (wheel)

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

Total release size: 83.5 kB

Release files / stacpkg-0.1.4.tar.gz

Download URL stacpkg-0.1.4.tar.gz
Size 37.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0149db0db542e7e2e9fb6d85f3e30507f180ff0c2e32c479aae02c7bd498533c
BLAKE2b-256 checksum
How to use checksums
6450288d7b2fc9bbbd51fe5118029ebe76b0c801ca30f1fda3bdf1263ef1b46e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log

Release files / stacpkg-0.1.4-py3-none-any.whl

Download URL stacpkg-0.1.4-py3-none-any.whl
Size 46.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
544cdfe748ca2a975b3db6b05d219355d289f75e3fb75d1f434e0398a9c6e170
BLAKE2b-256 checksum
How to use checksums
5aa881df8b28a91c07141a0ea56f0ed8aed0267a8a3a464cd15d90275fa8d633
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

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