Skip to main content

PyO3 bindings for commonmeta-rs's list/batch functions (VRAIX dump fetch+cache, Parquet I/O, batched archives)

Project description

commonmeta-rs (Python bindings)

PyO3 bindings exposing commonmeta-rs's list-command batch functions to Python: VRAIX daily-dump fetch with local caching, lossless Parquet read/write, and batched archive rendering. Records cross the FFI boundary as plain JSON-shaped dicts — the same shape commonmeta-py's own readers and writers already produce and consume.

Install

uv pip install commonmeta-rs

Requires CPython 3.14 or newer. The wheels are built against the stable ABI (abi3-py314), so one wheel per platform also covers later 3.x releases. commonmeta-py itself keeps a 3.9 floor; only this backend needs 3.14.

Development

The interpreter must be 3.14+, matching requires-python; an older venv fails to build rather than falling back.

uv venv --python 3.14 .venv
uv pip install --python .venv/bin/python maturin pytest
source .venv/bin/activate
maturin develop
pytest tests/

Release

Releases are published by hand. PyPI trusted publishing only issues OIDC identities to GitHub, GitLab, Google Cloud and ActiveState, and this repo lives on Codeberg, so CI cannot authenticate to PyPI — the workflow builds and tests wheels only.

The version comes from [workspace.package] in the root Cargo.toml and is shared with the commonmeta crate, so a wheel names the release it wraps. Bump it there, not here.

rm -rf dist
maturin build --release --out dist   # repeat per platform, or take CI artifacts
maturin sdist --out dist
uv publish --token "$PYPI_TOKEN" dist/*

Publishing from one machine uploads only that platform's wheel; other platforms fall back to building from the sdist. To ship binaries for every platform, collect the wheels-* artifacts from the workflow into dist/ first.

API

  • fetch_vraix(source, date, input_path=None, limit=None, offset=0, cache_ttl_days=30) -> list[dict] Fetch records from a VRAIX daily dump (source is "crossref" or "datacite"). With input_path, reads a local SQLite file directly (no network); otherwise downloads {source}-{date}.sqlite3.zst from metadata.vraix.org, caching it locally for cache_ttl_days.
  • write_parquet(records: list[dict]) -> bytes Write records as a single lossless Parquet file.
  • read_parquet(data: bytes) -> list[dict] Read records back from Parquet bytes written by write_parquet.
  • write_archive(records: list[dict], to: str, base_name: str, batch_size=100_000) -> list[tuple[str, bytes]] Render records to to format, split into batches of at most batch_size records, returned as (entry_name, bytes) pairs ready to pack into a zip/tar archive.
  • convert(from_: str, to: str, input: str) -> bytes Convert a single record between formats.

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

commonmeta_rs-0.9.35.tar.gz (727.0 kB view details)

Uploaded Source

Built Distributions

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

commonmeta_rs-0.9.35-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.1 MB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ x86-64

commonmeta_rs-0.9.35-cp314-abi3-macosx_11_0_arm64.whl (13.5 MB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

File details

Details for the file commonmeta_rs-0.9.35.tar.gz.

File metadata

  • Download URL: commonmeta_rs-0.9.35.tar.gz
  • Upload date:
  • Size: 727.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for commonmeta_rs-0.9.35.tar.gz
Algorithm Hash digest
SHA256 f4f14dc55342846ef333ba4b09f5a0de744bc37a025e4f0adf92746c1b6ba5fd
MD5 bdc1485795aa4b32312b3b193f1e7445
BLAKE2b-256 1f2300655753a808f82d36b9c8e3636efa4ef6a72a7c3a25d0e730a7baca542e

See more details on using hashes here.

File details

Details for the file commonmeta_rs-0.9.35-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: commonmeta_rs-0.9.35-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 15.1 MB
  • Tags: CPython 3.14+, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for commonmeta_rs-0.9.35-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f0c4e2b143ff2fbf5031b250cc1b17f83a58c8f9ff1a0800a00f61eccccd9a5b
MD5 54301242d7288346c903e896f7437f05
BLAKE2b-256 5fba37a1a4ac47065f6b3ef40093870e595562197a698d32b93ee106de0aba93

See more details on using hashes here.

File details

Details for the file commonmeta_rs-0.9.35-cp314-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: commonmeta_rs-0.9.35-cp314-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 13.5 MB
  • Tags: CPython 3.14+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for commonmeta_rs-0.9.35-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3769390681d9d00b709b9cd3da8c1109b8781a0f024facff74e64302fdb522c7
MD5 a4de1d7d2408dfcd340525791dee3263
BLAKE2b-256 6f297064748dc38e9479cbf77231209d3497e4af9ad81cd230b5d83153038044

See more details on using hashes here.

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