Skip to main content

juniper-recurrence-client

HTTP client for the juniper-recurrence service — the FastAPI app wrapping the Δt-native LMU recurrence model and its cross-validation API. A lean requests-based client mirroring juniper-data-client and juniper-cascor-client, so consumers (notably juniper-canopy's recurrence backend adapter) drive every Juniper backend the same way.

Install

pip install juniper-recurrence-client          # once published
pip install -e ".[test]"                        # local development

Names and source layout. Unlike its two sibling clients, this package is published from the juniper-recurrence-client/ subdirectory of the pcalnon/juniper-recurrence monorepo — there is no standalone juniper-recurrence-client repository. Three names are in play and all three differ:

What Value
Install (distribution name) pip install juniper-recurrence-client
Import (module name) import juniper_recurrence_client
Source (repository) pcalnon/juniper-recurrence, path juniper-recurrence-client/

So if import juniper_recurrence_client raises ModuleNotFoundError, the distribution to install is juniper-recurrence-client; and issues or PRs for this client belong on the juniper-recurrence repository.

requests-only at the core; pip install juniper-recurrence-client[observability] adds the optional juniper-observability integration (X-Request-ID propagation + the on_request hook).

Port: 8211 is the juniper-recurrence service's default host port; under Docker it maps to the container's 8210 (see the app README). Point the client at whichever host:port the service is published on.

Quick start

from juniper_recurrence_client import JuniperRecurrenceClient

client = JuniperRecurrenceClient("http://localhost:8211", api_key="…")

# Train the LMU regressor on a dataset (by id / name / generator)
client.train(name="equities", d=16)

# Predict — inline X with Δt, or a dataset reference
client.predict(dataset_id="ds-1")

# Walk-forward cross-validation over the trainval pool (juniper-recurrence 0.8.0, whose response
# reports the embargo it used under "folding"; older services use the whole `full` view). Omit
# `embargo` to take the service's default, one look-back from 0.8.0.
result = client.crossval(name="equities", n_folds=4, scheme="expanding")
print(result["eval_aggregate"])

# Inspect
client.get_model()        # topology + metrics
client.training_status()  # state + events
client.is_ready()         # readiness probe

API surface

Method Endpoint
train(*, dataset_id / name / generator, params, split, d, theta, ridge, readout, rff_*, mlp_*) POST /v1/train
training_status() GET /v1/training/status
predict(*, X / dt / target_dt / seq_lengths, or a dataset ref) POST /v1/predict
crossval(*, n_folds, scheme, embargo, min_train, dataset ref, d, theta, ridge, readout, rff_*, mlp_*) POST /v1/crossval
crossval_status() GET /v1/crossval/status
get_model() GET /v1/model
get_dataset() GET /v1/dataset
health_check() / is_ready() / wait_for_ready() GET /v1/health[/ready]

Authentication

Pass api_key=…, or set JUNIPER_RECURRENCE_API_KEY (or the Docker-secret JUNIPER_RECURRENCE_API_KEY_FILE, a path whose stripped contents are the key). The key is sent as the X-API-Key header. Note the asymmetry: the server reads the plural JUNIPER_RECURRENCE_API_KEYS (its accepted set); the client sends one key under the singular env var.

Errors

All errors derive from JuniperRecurrenceClientError: JuniperRecurrenceConnectionError, JuniperRecurrenceTimeoutError, JuniperRecurrenceNotFoundError (404), JuniperRecurrenceConflictError (409 — a run already in progress, or no trained model yet), JuniperRecurrenceValidationError (400/422), JuniperRecurrenceConfigurationError.

License

MIT — see LICENSE.

Metadata

Release files for juniper-recurrence-client 0.3.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 juniper-recurrence-client 0.3.1
File Size Uploaded Provenance Actions
juniper_recurrence_client-0.3.1.tar.gz 26.6 kB With provenance Details for juniper_recurrence_client-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for juniper-recurrence-client 0.3.1
File Interpreter ABI Platform Actions
juniper_recurrence_client-0.3.1-py3-none-any.whl Python 3 none any Details for juniper_recurrence_client-0.3.1-py3-none-any.whl

Total release size: 43.8 kB

Release files / juniper_recurrence_client-0.3.1.tar.gz

Download URL juniper_recurrence_client-0.3.1.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f3d59281c3dc4e7137a3758a84b87617f9f58a2f5a51226a49e2c426ca020832
BLAKE2b-256 checksum
How to use checksums
9dda98b68dfeb5cf0c9802769c3b22541aca00b91e196231f1e3040d11622363
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 Oct 27, 2026.

Transparency log

Release files / juniper_recurrence_client-0.3.1-py3-none-any.whl

Download URL juniper_recurrence_client-0.3.1-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
610449abfa9e1846170851e07344f9e5d49ff0defc9b8be0446c91d3cac5d5d1
BLAKE2b-256 checksum
How to use checksums
f3cbff419ed8227ca1cc92353ddd492397b9b5de76b8a54b5fedbe2be3787b64
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 Oct 27, 2026.

Transparency log

Security for juniper-recurrence-client 0.3.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for juniper_recurrence_client-0.3.1.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 27, 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.

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