Skip to main content

sequenx (SequenxAI Python client)

Python client for the SequenxAI platform API (packages/contracts/openapi.yaml is the single source of truth for the wire format). Install locally:

pip install -e packages/sequenx-py
from sequenx import SequenxClient

client = SequenxClient("sqx_live_...")
result = client.forecast(series, h=96)      # series: list[dict] with unique_id/ds/y
print(result["model_used"], result["usage"]["billable_points"])
client.close()

Covered endpoints (v1): POST /forecast, POST /forecast/rolling, POST /forecast/batch (+ get / cancel / delete job), POST /clean (dry-run), GET /models. POST /anomaly-detection is intentionally not covered (endpoint not open). PyPI publishing is a separate decision.

Idempotency and retries

The control plane claims an Idempotency-Key on POST /forecast, POST /forecast/rolling and POST /forecast/batch only: a repeated identical request replays the stored response instead of charging again. The SDK sends the key on exactly those three routes and reuses it across retries, so a transport error or a 429/5xx is retried safely (max_retries=0 disables retries).

A retry that races the original request can answer 409 (IDEMPOTENCY_IN_PROGRESS): the request that claimed the key is still running. The SDK retries it with the same key (the control plane replays the stored response once it settles). If it still cannot finish, the raised ConflictError carries the idempotency_key it used, so the call can be replayed safely:

from sequenx import ConflictError

try:
    out = client.forecast(series, h=96)
except ConflictError as exc:
    out = client.forecast(series, h=96, idempotency_key=exc.idempotency_key)

The SDK generates one key per call; pass your own idempotency_key= to forecast, forecast_rolling or forecast_batch when you want to hold on to it yourself.

Every other route is re-run by the control plane, so the SDK neither sends a key nor retries it automatically: POST /clean (a free dry-run), POST /forecast/batch/{job_id}/cancel and DELETE /forecast/batch/{job_id} (a repeated delete would answer 404 although the first delete succeeded — read the job with batch_job() when the outcome matters). GET requests are retried.

Batch jobs

forecast_batch() submits a job; batch_job() polls it, cancel_batch_job() cancels it and delete_batch_job() removes a finished job and its result file. Polling is the caller's loop.

Errors

Errors are typed (AuthenticationError, ValidationError, RateLimitedError, ServerError, TransportError, ...) and carry the contract's code / request_id / status.

Response types

Responses are typed too (ForecastResponse, RollingForecastResponse, ModelList, BatchJobSummary, BatchJobDetail, CleanResponse, ...); the shapes mirror the contract schemas and the package ships py.typed. Nested objects the SDK does not model (intervals, cleaning report, effective policy) stay plain dictionaries.

DataFrames

pandas and polars frames are accepted as input (pip install -e "packages/sequenx-py[pandas]" or [polars]); neither is required.

Development

pip install -e packages/sequenx-py -r packages/sequenx-py/requirements-dev.txt
python -m pytest -q          # unit + contract drift tests
python -m ruff check src tests
SEQUENX_SDK_LIVE_SMOKE=1 SEQUENX_API_KEY=sqx_live_... python scripts/live_smoke.py

The live smoke is opt-in and never passes silently: without the flag and key it exits 2 with instructions. The contract drift test reads packages/contracts/openapi.yaml and fails when the SDK and the contract disagree; Gitee Go runs it via scripts/ci/gitee-verify.sh sdk.

Metadata

Release files for sequenx-ai 0.1.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 sequenx-ai 0.1.0
File Size Uploaded Provenance Actions
sequenx_ai-0.1.0.tar.gz 16.7 kB Without provenance Details for sequenx_ai-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sequenx-ai 0.1.0
File Interpreter ABI Platform Actions
sequenx_ai-0.1.0-py3-none-any.whl Python 3 none any Details for sequenx_ai-0.1.0-py3-none-any.whl

Total release size: 29.2 kB

Release files / sequenx_ai-0.1.0.tar.gz

Download URL sequenx_ai-0.1.0.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7af8a409ec973ad2cb6d3544d3e89a17e027b5f80f2a2c2af383243c8ac9f0de
BLAKE2b-256 checksum
How to use checksums
b35d07d6f753e88836baf6ad576f63e71dfc3ff20ad5cbb241cd5a90c236a56e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / sequenx_ai-0.1.0-py3-none-any.whl

Download URL sequenx_ai-0.1.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0024b065a873376158e442351f1ffc7ce4263329b4d419f749e177a914da6837
BLAKE2b-256 checksum
How to use checksums
0815530011b33ec446247a53d18ddc62d2fbb400dfa150ccc266f41da178d690
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for sequenx-ai 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.1.0 This release

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