Skip to main content

Thin Python client for the Provenarium extraction API.

Project description

Provenarium Python Client

provenarium_client is a thin Python wrapper around the public Provenarium API.

It is intentionally focused on the main data-team workflow:

  • list, create, and rotate machine API keys
  • create or reuse schemas
  • submit extraction jobs
  • poll for results
  • request hosted review for completed work
  • manage webhook destinations

Full guide: docs.provenarium.com/python-client

Install

If the client is being distributed through PyPI for your environment:

pip install provenarium-client

Otherwise install it from the wheel, source checkout, or private package path provided for your environment.

The client defaults to https://api.provenarium.com. Only override base_url when pointing at a local or non-default hosted environment.

Quickstart

from provenarium_client import SchemaField, ProvenariumClient

with ProvenariumClient(
    api_key="pk_live_...",
) as client:
    schema = client.create_schema(
        name="Assay Packet",
        description="Fields to pull from assay packets.",
        fields=[
            SchemaField(
                name="study_id",
                display_name="Study ID",
                description="Internal study identifier.",
                group="study_info",
                path="study_info.study_id",
                field_type="String",
            ),
            SchemaField(
                name="run_id",
                display_name="Run ID",
                description="Instrument run identifier.",
                group="assay_run",
                path="assay_run.run_id",
                field_type="String",
            ),
        ],
    )

    job = client.submit_job(
        file_path="packet.pdf",
        schema_id=schema.id,
    )

    result = client.wait_for_result(
        job.id,
        poll_interval_seconds=2.0,
        timeout_seconds=120.0,
    )

    print(result.summary.field_count)
    print(result.fields[0].value)

Hosted Review

Route a completed job into hosted review later:

from provenarium_client import ProvenariumClient

with ProvenariumClient(api_key="pk_live_...") as client:
    reviewed_job = client.request_review(
        "job_123",
        reviewer_email="reviewer@example.com",
        reviewer_team="qa-team",
    )
    print(reviewed_job.review.status)
    print(reviewed_job.reviewer_notification)

If review should be part of the job from the start, pass requires_review=True and reviewer details directly to submit_job(...).

API Keys

The client can also wrap the public API-key routes for scripted key rotation:

from provenarium_client import ProvenariumClient

with ProvenariumClient(api_key="pk_admin_...") as client:
    created = client.create_api_key(
        name="ingestion-bot",
        role="member",
    )
    print(created.token)

    for key in client.list_api_keys():
        print(key.name, key.role, key.is_active)

    client.delete_api_key(created.id)

Notes

  • this client wraps the public /api/v1/* surface only
  • API key management calls require an owner or admin team API key
  • use the docs app and API reference for the canonical integration guide and exact wire payloads
  • it does not cover dashboard auth, internal provisioning, or reviewer submission
  • the package is intentionally a lightweight convenience layer, not a heavy SDK

Tests

uv run pytest -q

Publishing

The client is published through GitHub Actions, separately from the hosted app deploy.

Release flow:

git tag client-v0.1.0
git push origin client-v0.1.0

Notes:

  • the tag must match the version in pyproject.toml
  • the workflow builds the wheel and source distribution, runs twine check, and then publishes to PyPI
  • publishing uses PyPI Trusted Publishing through GitHub Actions OIDC, not a long-lived API token
  • the GitHub repository should have a pypi environment, and PyPI should trust this repo/workflow pair

PyPI Trusted Publisher fields:

  • PyPI project name: provenarium-client
  • Owner: andrewruba
  • Repository name: provenarium
  • Workflow name: publish-client.yml
  • Environment name: pypi

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

provenarium_client-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

provenarium_client-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file provenarium_client-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for provenarium_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c21fa3423a4dc7942516c02e97f37614e1dafd3cdb389dd8d643060751236b51
MD5 278192fedb402c509b2207ae6775dc05
BLAKE2b-256 dc088e158b2ebb15eca76f4c4394f7150a824cdd0de8317d5cf240e9305972d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for provenarium_client-0.1.0.tar.gz:

Publisher: publish-client.yml on andrewruba/provenarium

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

File details

Details for the file provenarium_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for provenarium_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27b540e0cd95e398c17faadc0d3b2c663fe276c829da3cd0f20d645eedc02805
MD5 e3051f6ac1384c3bce54f607b8317919
BLAKE2b-256 f0b7d4f12a3f62fca9f64d0cd4eb56464dd1883f35c8c115b0f3c25c0d05b481

See more details on using hashes here.

Provenance

The following attestation bundles were made for provenarium_client-0.1.0-py3-none-any.whl:

Publisher: publish-client.yml on andrewruba/provenarium

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