Skip to main content

Periplus Python SDK

A read-only client for the public Periplus query API. Python 3.11 or later. Configure the public web application URL, not the internal query or control service. No API token, DuckDB installation or lake credentials are needed.

from periplus_sdk import Client

with Client("http://localhost:8080") as client:
    result = client.execute(
        "SELECT observation_id FROM web.observation LIMIT ?", [10]
    )
    print(result.columns, result.types)
    print(result.rows)
    print(result.source_snapshot, result.truncated)

For a hosted deployment, replace the URL with its public HTTPS origin. Alternatively set PERIPLUS_PUBLIC_URL and use Client(). An optional URL path prefix is preserved. The client reuses HTTP connections; close it with a context manager or close().

Preparation and helpers

with Client("http://localhost:8080") as client:
    prepared = client.prepare("SELECT observation_id FROM web.observation LIMIT ?", [10])
    print(prepared.diagnostics, prepared.plan)
    result = client.execute(prepared.sql, prepared.parameters)
    helpers = client.helpers()
    print(helpers.catalogue_version, helpers.helpers)

Preparation validates and explains without executing the analytical query. Execution independently validates and prepares; a prior preparation never authorizes SQL. Linting, diagnostics and future SQL optimizations belong to the server. The SDK sends SQL unchanged.

Async use

from periplus_sdk import AsyncClient

async def observations():
    async with AsyncClient("http://localhost:8080") as client:
        return await client.execute("SELECT observation_id FROM web.observation LIMIT 10")

Use aclose() when managing an async client's lifetime explicitly.

Permissions, results and errors

  • The same public SQL feature switch, shared rate budget, namespace validation and read-only execution apply as in the public web workspace. The SDK provides no writes, crawling, administrative controls or direct lake attachment.
  • Results retain query_id, SQL, parameters, diagnostics, plan, columns, SQL types, JSON rows, elapsed milliseconds, source_snapshot and truncated. Decimals and large integers remain strings exactly as returned by the server. Duplicate column names are preserved.
  • Operator-configured execution limits default to 1,000 rows, an 8 MiB result budget and a 20-second server deadline. Always inspect truncated. The SDK does not silently fetch more rows or retry.
  • ApiError exposes status_code, safe code, and retry_after_seconds when supplied. TransportError means HTTP failed; ResponseError means a malformed successful response. The client timeout defaults to 140 seconds and can be set with timeout=. A timeout or local cancellation does not guarantee server cancellation. Redirects are not followed automatically.
  • Preparation and execution are attributed to sdk in the existing private query history. Original SQL and parameters are retained for 30 days; result rows are not stored. Recording is best-effort and can be lost during outages or backpressure. This label is not a user identity.

Installation and verification

Install from PyPI:

python -m pip install periplus-python-sdk==0.2.0

For local development: python -m pip install ./packages/periplus-python-sdk. Run the installed package against an available public app:

PERIPLUS_PUBLIC_URL=http://localhost:8080 python packages/periplus-python-sdk/examples/smoke.py

Releasing

Repository CI publishes immutable releases from tags named periplus-python-sdk-v<version>. The tag must exactly match the static version in pyproject.toml; for example, version 0.2.0 is released with:

git tag periplus-python-sdk-v0.2.0
git push origin periplus-python-sdk-v0.2.0

PyPI publishing uses Trusted Publishing rather than a stored API token. The PyPI publisher must be configured for GitHub owner elei-io, repository periplus, workflow python-sdk-release.yml, and environment pypi. Protect that GitHub environment with required reviewers before the first release.

Release files for periplus-python-sdk 0.2.0

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

Source distribution (sdist)

Source distribution for periplus-python-sdk 0.2.0
File Size Uploaded
periplus_python_sdk-0.2.0.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for periplus-python-sdk 0.2.0
File Interpreter ABI Platform
periplus_python_sdk-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / periplus_python_sdk-0.2.0.tar.gz

Download URL periplus_python_sdk-0.2.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c5c38e73d23249778b7c237b13e5bb6b6591e900180b2e725cdab751da53a248
BLAKE2b-256 checksum
How to use checksums
333e9fbfe7b4aebb6a25e6025feb5f53adbc923669c6847a813fde44bd2da856
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 8, 2026.

Transparency log

Release files / periplus_python_sdk-0.2.0-py3-none-any.whl

Download URL periplus_python_sdk-0.2.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48d65def224db763783babbc66b10d0cad52cd9149aa19ed00c66b99741d9b1d
BLAKE2b-256 checksum
How to use checksums
ef383ee852023cc584e0155399c88619eb3d53e8351aa0dac44a753c032230ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.11.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release 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