Skip to main content

juniper-data

PyPI Python 3.12+ License: MIT

A FastAPI service that generates, versions, and serves ML datasets as NPZ artifacts.

juniper-data turns a catalogue of dataset generators into a REST service: you ask it for a dataset by name and parameters, and it returns a versioned, NPZ-formatted train/test/full split. The catalogue spans synthetic classification problems (two-spiral, concentric circles, XOR, Gaussian mixtures, moons, checkerboard), image sets (MNIST), the ARC-AGI visual-reasoning families, a CSV/JSON import path, and a family of time-series and irregularly-sampled sequence generators (autoregressive, Mackey-Glass, multi-sine, delay-product, equities, and the irregular-Δt equities_seq contract). A named-version registry, tag filtering, batch creation, and per-dataset preview round out the surface. Call GET /v1/generators for the live catalogue.

It is the foundational data layer of the platform: the dataset identifiers it returns are the substrate juniper-cascor trains on and juniper-canopy visualises.

Part of the Juniper platform. juniper-data is the dataset-generation service of Juniper — a multi-package ML research platform built around constructive (Cascade-Correlation) and recurrent neural networks. It runs standalone; the rest of the platform consumes it over HTTP (see juniper-data-client).

Install

pip install juniper-data            # from PyPI

For development from a clone (the optional extras are api, arc-agi, equities, mnist, observability, test, dev, all):

git clone https://github.com/pcalnon/juniper-data.git && cd juniper-data
pip install -e ".[all]"

MNIST / Fashion-MNIST (optional extra)

The mnist generator loads the real MNIST / Fashion-MNIST datasets from the Hugging Face Hub and needs the (heavy) datasets chain, shipped behind an explicit extra — it is never part of the base install:

pip install "juniper-data[mnist]"
  • First call downloads from the Hub into the Hugging Face cache (HF_HOME, default ~/.cache/huggingface; the Docker image pins it to /app/data/hf-cache so a mounted data volume persists it). Later calls are served from the cache.
  • Offline deployments must seed that cache ahead of time (run one generation for each dataset while online, or copy a populated HF_HOME in); with HF_HUB_OFFLINE=1 the generator then works entirely from the cache.
  • Without the extra installed, the generator is unavailable: the registry reports available: false and POST /v1/datasets returns 501 with the install hint instead of a masked 500.
  • The service Docker image ships the extra (it is compiled into requirements.lock), so MNIST generation works in containers out of the box.

Run

uvicorn --factory juniper_data.api.app:get_app --reload    # binds 127.0.0.1:8100
curl http://localhost:8100/v1/health/ready
curl http://localhost:8100/v1/generators                   # the live generator catalogue

Create a dataset over the REST API:

curl -sX POST localhost:8100/v1/datasets \
  -H 'Content-Type: application/json' \
  -d '{"generator": "spiral", "name": "demo", "params": {"n_spirals": 2, "noise": 0.1}}'

Or generate one in-process, without the service:

from juniper_data.generators import SpiralGenerator, SpiralParams

dataset = SpiralGenerator.generate(SpiralParams(n_spirals=2, n_points_per_spiral=100, noise=0.1))
# dataset: dict of float32 arrays — X_train, y_train, X_val, y_val, X_test, y_test

Data contract

Datasets are NPZ archives with the keys X_train, y_train, X_val, y_val, X_test, y_test, all float32. This is the contract every Juniper consumer reads.

Configuration

Settings load from the JUNIPER_DATA_ environment namespace (juniper_data/api/settings.py) and honor the Docker _FILE secret convention. The most common knobs (full surface in docs/REFERENCE.md):

Variable Default Purpose
JUNIPER_DATA_HOST / JUNIPER_DATA_PORT 127.0.0.1 / 8100 Bind address / port (0.0.0.0 under Docker).
JUNIPER_DATA_STORAGE_PATH ./data/datasets Where persisted dataset artifacts live.
JUNIPER_DATA_API_KEYS (unset) CSV / JSON-array of X-API-Key values; auth is disabled when unset.
JUNIPER_DATA_LOG_LEVEL / _LOG_FORMAT INFO / text Verbosity / text or json.
JUNIPER_DATA_METRICS_ENABLED false Expose /metrics for Prometheus (IP-gated).

Docker

docker build -t juniper-data:latest .
docker run --rm -p 8100:8100 -e JUNIPER_DATA_HOST=0.0.0.0 juniper-data:latest

Multi-stage build (Python 3.14-slim); health is probed at /v1/health/ready. For the full stack, see juniper-deploy.

Status

Live on PyPI. The current version is shown by the badge above; see CHANGELOG.md. Consumed by juniper-cascor and juniper-canopy via JUNIPER_DATA_URL, and by juniper-data-client programmatically.

Documentation

License

MIT — see LICENSE.

Release files for juniper-data 0.14.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 juniper-data 0.14.0
File Size Uploaded
juniper_data-0.14.0.tar.gz 457.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for juniper-data 0.14.0
File Interpreter ABI Platform
juniper_data-0.14.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.0 MB

Release files / juniper_data-0.14.0.tar.gz

Download URL juniper_data-0.14.0.tar.gz
Size 457.2 kB
Tags Source
SHA-256 checksum
How to use checksums
65c2c951022db7d6ce4c45a9a914e1a9c654d59d0767474f82d3db92cd995998
BLAKE2b-256 checksum
How to use checksums
b5ddb1192785694392a2c9eae2188e3480b038c9f3528fdf4bcfec2c3be7b97d
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 10, 2026.

Transparency log

Release files / juniper_data-0.14.0-py3-none-any.whl

Download URL juniper_data-0.14.0-py3-none-any.whl
Size 552.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50cc184ea5e75b93d3180ac46f7bddaaf5517a68fc6691e0a74e2d47ed57a419
BLAKE2b-256 checksum
How to use checksums
70cfb723d1679b09a02c29c13dd0cc88678eb50651adb4dee24542d6a431b362
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 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.16.0

2 release files

0.15.0

2 release files

This release

0.14.0 This release

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.4.2

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