Skip to main content

fwl-io

CI Documentation PyPI License: Apache-2.0

Shared data-download utilities for the PROTEUS ecosystem: manifest-driven, mirrored, offline-first fetching of the reference data used by the FormingWorlds models.

Status: version 0, released for inspection and feedback by the collaboration. The API is not yet frozen; suggestions are welcome as issues. Documentation: proteus-framework.org/fwl-io.

What it does

Models in the PROTEUS framework depend on reference data hosted on Zenodo (with Dataverse mirrors): spectral files, equation-of-state lookup tables, stellar evolution tracks. fwl-io provides one shared mechanism to declare, verify, and fetch these datasets into the common FWL_DATA directory tree:

  • Manifests: each dataset is declared in a TOML manifest with its location below FWL_DATA, its Zenodo version DOI, an optional Dataverse mirror DOI, and the models that require it. fwl-io ships a manifest for datasets shared across models; each model package can ship its own manifest (plus the generated registry files, both included in its package data) and expose it through the fwl_io.manifests entry-point group, so adding data to a model never requires an fwl-io release. A provider whose manifest fails to load is skipped with a warning; it cannot break data access for the other models.
  • Committed registries: the file names and checksums of every dataset live in registry files generated by fwl-io sync from the Zenodo API. Hashes are pinned in version control and reviewed like code; nothing is hand-edited. The checksums are the ones Zenodo publishes (md5 today), so the Dataverse mirror must host byte-identical copies of the originals; disable Dataverse's tabular ingest for mirrored deposits.
  • Version DOIs only: manifests pin the DOI of a specific deposit, and every dataset requires a Zenodo version DOI (Dataverse serves as a download mirror). fwl-io sync rejects concept DOIs, which resolve to the newest deposit and would let data drift underneath pinned code.
  • Mirrored downloads: every file is fetched with pooch, verified against its checksum, tried against Zenodo first and the Dataverse mirror second, and moved into place atomically (staged on the same filesystem, os.replace into place) so an interrupted download can never leave a corrupt file behind. Local placement failures such as a read-only tree or a full disk are reported as themselves, never as mirror failures. A deposit packaged as a single archive (extract = "tar" / "zip") is downloaded, checksum-verified, and unpacked into the dataset directory, with the archive itself discarded.
  • Concurrent-safe: when many processes start together and all need the same missing file, a per-file inter-process lock lets only one download it while the others wait and reuse the result, so a batch of runs cannot stampede Zenodo/Dataverse into rate-limiting the collaboration. The lock is coherent across cluster nodes where the shared filesystem supports it, and best-effort: if locking is unavailable or a holder stalls, waiters fall back to fetching unguarded rather than failing.
  • Offline-first: with FWL_IO_OFFLINE=1 no network access is attempted; files resolve from the local tree or fail with an actionable error. A read-only, pre-populated group cache (FWL_DATA_CACHE) is consulted before any download, which serves cluster nodes without internet access.

Installation

pip install fwl-io

The distribution and the command are named fwl-io; the Python import is fwl_io, since Python does not allow hyphens in module names.

Usage

from fwl_io import create_fetcher, fetch_for

eos = create_fetcher(
    subdir='interior/eos/mgsio3_demo',
    zenodo='10.5281/zenodo.1234567',
    dataverse='10.34894/ABCDEF',
    registry='interior.eos.mgsio3_demo.registry.txt',
)
path = eos.fetch('density.dat')      # cached, verified, atomic
paths = fetch_for('aragog')          # everything a model requires
records = eos.provenance()           # (file, source, checksum) for run manifests

Command line:

fwl-io list                     # datasets from all installed manifests
fwl-io fetch aragog             # fetch everything aragog requires
fwl-io sync manifest.toml       # regenerate committed registries from Zenodo

Environment variables

Variable Meaning
FWL_DATA Root of the writable data tree. Required unless an explicit data_root is passed; there is no silent default location.
FWL_DATA_CACHE Optional read-only, pre-populated copy of the tree (for example a group share on a cluster); consulted before any download, never written.
FWL_IO_OFFLINE Set to 1 to forbid all network access.

Adding a dataset

  1. Upload the files to Zenodo and note the version DOI of the deposit.
  2. Declare the dataset in the appropriate manifest: the shared manifest in this repository for data consumed by several models, or the consuming model's own manifest for model-specific data.
  3. Run fwl-io sync <manifest> and commit the manifest change together with the generated registry file. Packages that ship their own manifest must include both the manifest and its registry files in their package data, or fetching fails at runtime on the user's machine.
  4. Optionally mirror the deposit to Dataverse (byte-identical, tabular ingest disabled) and add the dataverse DOI.

Development

pip install -e ".[develop]"
pytest -m "unit or smoke"       # fast tier, no network
pytest                          # full suite; uses a local test server only
ruff check src tests && ruff format --check src tests

The test suite never contacts external services; download logic is exercised against a local HTTP server.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fwl_io-26.7.25.tar.gz (647.2 kB view details)

Uploaded Source

Built Distribution

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

fwl_io-26.7.25-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file fwl_io-26.7.25.tar.gz.

File metadata

  • Download URL: fwl_io-26.7.25.tar.gz
  • Upload date:
  • Size: 647.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for fwl_io-26.7.25.tar.gz
Algorithm Hash digest
SHA256 88ea4dfdbadd00221af26b54db2ee0336c940d521beda5af2a5136bb08cd478e
MD5 a6b2e06b7f20466ac25341085618a72f
BLAKE2b-256 174c718a187f2611c8d96865b2b59c526f89a4ff4eeaffd64009f99c70dc4267

See more details on using hashes here.

Provenance

The following attestation bundles were made for fwl_io-26.7.25.tar.gz:

Publisher: publish.yaml on FormingWorlds/fwl-io

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

File details

Details for the file fwl_io-26.7.25-py3-none-any.whl.

File metadata

  • Download URL: fwl_io-26.7.25-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for fwl_io-26.7.25-py3-none-any.whl
Algorithm Hash digest
SHA256 474e6f9b46cba8ae9f1f6db5db57d33c48aa0cdd4c12550b0ffc3889dc1b8c97
MD5 6315ca1747e5ec568dff696f80b0eb4c
BLAKE2b-256 b677b2c2fd5e9f9ffd9b4add201c52ab2987044058bec0284b7b1446ff0cf171

See more details on using hashes here.

Provenance

The following attestation bundles were made for fwl_io-26.7.25-py3-none-any.whl:

Publisher: publish.yaml on FormingWorlds/fwl-io

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

Release history Release notifications | RSS feed

26.8.31

2 files

This release

26.7.25 This release

2 files

26.7.22

2 files

26.7.20

2 files

26.7.19

2 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