Skip to main content

A schema-aware data generation and testing platform for Python

Project description

PyCatalyst

Schema-aware data generation and testing: recipes (YAML), REST API, optional UI, schema inference, and ML hooks.

Documentation

Tutorial index in the doc site: Quick Start, API authentication, generate, recipes, infer schema, workbench.

Installation

pip install pycatalyst

API server, DB, and common extras:

pip install "pycatalyst[api,db,inference,faker]"

From source (editable):

git clone https://github.com/optophi/pycatalyst
cd pycatalyst
pip install -e ".[dev]"

Quick Start (CLI)

pycatalyst api --port 8005
pycatalyst generate --recipe path/to/recipe.yaml -n 10

See the Quick Start page in the docs for database setup, UI, and REST examples.

Streaming mock data

Python — same sequence as batch generation for a fixed seed:

from pycatalyst import GenerationEngine, SchemaBuilder

engine = GenerationEngine()
schema = SchemaBuilder("events").add_uuid("id").add_string("kind").build()
for row in engine.iter_records(schema, seed=123, limit=1000):
    process(row)

HTTP (Server-Sent Events)POST /api/v1/stream/sse with the same field list as /generate, plus max_records and optional interval_ms. Use curl -N and a Bearer token when auth is enabled:

curl -N -H "Authorization: Bearer YOUR_JWT" -H "Content-Type: application/json" \
  -d '{"name":"x","fields":[{"name":"n","type":"int"}],"max_records":5,"seed":1}' \
  http://127.0.0.1:8005/api/v1/stream/sse

CLI — NDJSON to stdout (one JSON object per line):

pycatalyst stream ndjson --schema my.json -n 500 --seed 1

CLI — Kafka (pip install pycatalyst[kafka]):

export PYCATALYST_STREAM_KAFKA_BOOTSTRAP=localhost:9092
export PYCATALYST_STREAM_KAFKA_TOPIC=test-topic
pycatalyst stream kafka --schema my.json -n 2000 --batch 100

Server caps (optional): PYCATALYST_STREAM_MAX_RECORDS, PYCATALYST_STREAM_MAX_INTERVAL_MS.

Development

  • Lint & format: ruff check . && ruff format .
  • Type check: mypy src/
  • Tests: pytest
  • Coverage: pytest --cov=pycatalyst --cov-report=term-missing

Publishing

  1. Bump version in pyproject.toml and CHANGELOG.md.
  2. Create a release tag: git tag v0.1.0 && git push origin v0.1.0.
  3. The GitHub Action uses PyPI Trusted Publishing; configure the publisher on PyPI for this repo, then the workflow will publish on tag push.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycatalyst-0.0.15.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycatalyst-0.0.15-py3-none-any.whl (2.5 MB view details)

Uploaded Python 3

File details

Details for the file pycatalyst-0.0.15.tar.gz.

File metadata

  • Download URL: pycatalyst-0.0.15.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pycatalyst-0.0.15.tar.gz
Algorithm Hash digest
SHA256 77a321a8fa23efb9899a7bd18b4280c422517ad8adaf51db8be23c4f43c1e2f1
MD5 cef47564dd3eaf4d46f4157fb7a5e8f2
BLAKE2b-256 077cce20b854f7da8763b0d6fc80b31a8544668b69b6ea4b2b6ba5ce9bbfecc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycatalyst-0.0.15.tar.gz:

Publisher: publish.yml on optophi/pycatalyst

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycatalyst-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: pycatalyst-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pycatalyst-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 cb52350d427342393999d83c484717c041ceab26b39495afd1f65eedd4ab7d29
MD5 a4d4a8adf971675d9e36ee12f0c7a051
BLAKE2b-256 c6cf710ae76f27dc179e33021332e4a29f716115014d4cb1789011e38246096b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycatalyst-0.0.15-py3-none-any.whl:

Publisher: publish.yml on optophi/pycatalyst

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page