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
  • the package is intentionally a lightweight convenience layer, not a heavy SDK

Tests

uv run pytest -q

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.1.tar.gz (12.0 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.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: provenarium_client-0.1.1.tar.gz
  • Upload date:
  • Size: 12.0 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.1.tar.gz
Algorithm Hash digest
SHA256 236097a31613b1a31eed1485009704d0f1d0ad5bc30e75957786ab42e7362b41
MD5 b319bfec8a3425a608eff84437eaf381
BLAKE2b-256 215bca9831cdfc0cff7349dcbe1032245c9448f079f4bda25abd498ac9325615

See more details on using hashes here.

Provenance

The following attestation bundles were made for provenarium_client-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for provenarium_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78ccf09a3dd985f1b5bda6c8728b7cb10987247f3b9535ae7f396e30e8c7409c
MD5 f8702b3e085b73d7c1091125f9608ba3
BLAKE2b-256 f6d088c7404bdef0d7f87044dceed0825c82a2953a9d6bf4aca2f49962a14cfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for provenarium_client-0.1.1-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