Skip to main content

prax (PRAX SDK)

Typed HTTP clients, API models, and authored input helpers for PRAX applications. The Python distribution and import name are prax.

Working with PRAX

Use the SDK to:

  • Read exact service-instance health, metrics and usage, and stream logs with PraxAPIClient.
  • Read and compare authored ProjectSpec revisions with bounded history operations.
  • Validate and manipulate pipeline/stage inputs with prax.spec and prax.project_spec_workflow.
  • Work with typed request/response data through prax.models.

The asynchronous client supports context-manager cleanup, request timeouts, and bounded pagination. Authorize requests with an API token for your environment; resource access follows your account's permissions.

Example

Set PRAX_API_URL to your PRAX endpoint and PRAX_API_TOKEN to your API token. Substitute a project name and revision number accessible to your account.

import asyncio
import os

from prax import PraxAPIClient


async def main():
    async with PraxAPIClient(
        os.environ["PRAX_API_URL"], token=os.environ["PRAX_API_TOKEN"]
    ) as client:
        revision = await client.get_project_spec_revision("forecast-project", 1)
        print(revision.model_dump_json())


if __name__ == "__main__":
    asyncio.run(main())

Following service-instance logs

Use the complete project, stage, service and stage-incarnation identity returned by the API. Open logs with async with, not await: the context owns the response and closes it on completion, an early exit, error or cancellation.

async with client.stream_service_instance_logs(
    project_ref="forecast-project",
    stage_ref="production",
    service_name="api",
    stage_incarnation=stage_incarnation,
    org="oceanum",
    follow=True,
    tail=100,
) as response:
    async for line in response.aiter_lines():
        print(line)

Read the response only inside this context. Follow has no idle read deadline; connection, write and pool timeouts remain those of the client. Snapshot requests retain the normal read timeout. Injected/shared HTTP clients remain caller-owned. No status lookup or repeated reconnection is needed to receive a live line.

Errors

Client operations raise PraxAPIError. Use its .status, .code, and .reason attributes to handle errors programmatically.

Catch this exception around awaited client operations to distinguish API responses from transport failures and decide whether to retry.

Requirements

Python 3.11+ is required. Runtime dependencies are Pydantic, Pydantic Settings, HTTPX, and PyYAML; version bounds are declared in pyproject.toml.

Versions

The SDK and CLI share the same release version. Each CLI release depends on the matching prax SDK release. To inspect your installed SDK version:

from importlib.metadata import version

print(version("oceanum-prax-sdk"))

See also

Metadata

Release files for oceanum-prax-sdk 0.3.2

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

Source distribution (sdist)

Source distribution for oceanum-prax-sdk 0.3.2
File Size Uploaded Provenance Actions
oceanum_prax_sdk-0.3.2.tar.gz 32.5 kB With provenance Details for oceanum_prax_sdk-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for oceanum-prax-sdk 0.3.2
File Interpreter ABI Platform Actions
oceanum_prax_sdk-0.3.2-py3-none-any.whl Python 3 none any Details for oceanum_prax_sdk-0.3.2-py3-none-any.whl

Total release size: 65.6 kB

Release files / oceanum_prax_sdk-0.3.2.tar.gz

Download URL oceanum_prax_sdk-0.3.2.tar.gz
Size 32.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e012999eea82a745c3275ee37d5c18619e286e31eb6eb3f1a4a7e65a3a88fd90
BLAKE2b-256 checksum
How to use checksums
a715c9fc4d6f67ffed675492d2f5f3149f8bf8e7fc002288e717ca3181cf9068
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 26, 2026.

Transparency log

Release files / oceanum_prax_sdk-0.3.2-py3-none-any.whl

Download URL oceanum_prax_sdk-0.3.2-py3-none-any.whl
Size 33.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e69fc8cdddb32b1847e129da9679c796e37a13315235c127a2f91700eda8bc35
BLAKE2b-256 checksum
How to use checksums
86113acc22a2bf747615610bbe92d7356097c0735a806383107af366a7ad3a8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 26, 2026.

Transparency log

Security for oceanum-prax-sdk 0.3.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for oceanum_prax_sdk-0.3.2.tar.gz

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 Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files Full provenance

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