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). Published on PyPI as sequenx-ai:

pip install sequenx-ai

To work on the client itself, install it from this repository in editable mode (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).

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.1

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.1
File Size Uploaded Provenance Actions
sequenx_ai-0.1.1.tar.gz 16.8 kB Without provenance Details for sequenx_ai-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 29.3 kB

Release files / sequenx_ai-0.1.1.tar.gz

Download URL sequenx_ai-0.1.1.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
764b36b5253d39ab0a3ba88bf5263623faaa66b677bea1db964bd737a58b5c4d
BLAKE2b-256 checksum
How to use checksums
ea2b5884ec2f3ea240579e26a49e039db9240a2b26f0877994ddbb441cb6ec6e
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.1-py3-none-any.whl

Download URL sequenx_ai-0.1.1-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1179f2460603eabf2f970839ebe65ffaa316650d7e8d75ca2b5040d752c28206
BLAKE2b-256 checksum
How to use checksums
3f5e4e6cfdf46af76d0b9ac99f45276faa22cf74517cb257322af8bf70ff5314
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.1

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.1 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