Skip to main content

rand-engine

Synthetic data, very fast, from a declarative RandSpec — for batch and streaming, on any platform. The core is Python + NumPy; Spark is supported, never required, and Faker composes on top.

PyPI Python License Tests

Install

pip install rand-engine
pip install "rand-engine[faker]"  # optional: Faker pools

30-second example

A spec maps each column to a method and its kwargs; the seed makes it reproducible.

from rand_engine import DataGenerator

spec = {
    "user_id": {"method": "int_zfilled", "kwargs": {"length": 8}},
    "age": {"method": "integers", "kwargs": {"min": 18, "max": 80}},
    "plan": {"method": "distincts_prop", "kwargs": {"distincts": {"free": 8, "pro": 2}}},
    "signup": {"method": "dates", "kwargs": {"start": "2024-01-01", "end": "2024-12-31"}},
}

df = DataGenerator(spec, seed=42).size(1_000).get_df()
assert df.shape == (1_000, 4) and df["age"].between(18, 80).all()

When to use it

  • Test data for pipelines, with nulls and anomalies on demand.
  • Related tables whose pk and fk keys stay consistent across batches, streams and files.
  • Event streams and files for queues, lakes, databases or Spark, at NumPy speed.

Get-started starters

rand-engine list prints six starters. Five are runnable examples: rand-engine get-started <slug> writes <slug>-example.py (also python -m rand_engine get-started <slug>, with --out DIR to choose the folder).

  • test-data: a DataFrame for pipeline tests with null_rate and anomaly_rate.
  • lake: pk/fk related tables written to a Parquet lake.
  • kafka: an event stream for Kafka, JSON lines to stdout by default.
  • databricks: a Spark/Databricks notebook on native SparkGenerator.
  • faker: Faker pools sampled at NumPy speed through RandSpecs.faker_pool.

The optional agent starter writes AGENTS.md with package-use context for an existing project:

rand-engine get-started agent --out PROJECT

It begins in 0.8.0 and does not overwrite an existing PROJECT/AGENTS.md; review and merge it with the project's own instructions.

Documentation and support

Full guides and the method reference live on the docs site. Start with compatibility, migration and recovery when choosing Python or Spark, and use the rand-engine skill or the Agent context starter for an AI agent.

Contributions use CONTRIBUTING.md; questions and ordinary bugs belong in GitHub Issues. Potential vulnerabilities use the private route in SECURITY.md.

Metadata

Release files for rand-engine 0.8.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 rand-engine 0.8.1
File Size Uploaded Provenance Actions
rand_engine-0.8.1.tar.gz 55.0 kB With provenance Details for rand_engine-0.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rand-engine 0.8.1
File Interpreter ABI Platform Actions
rand_engine-0.8.1-py3-none-any.whl Python 3 none any Details for rand_engine-0.8.1-py3-none-any.whl

Total release size: 125.0 kB

Release files / rand_engine-0.8.1.tar.gz

Download URL rand_engine-0.8.1.tar.gz
Size 55.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a74749c36b0de95eb15889553b1488ab4270c0b7af3f5e28b06c9383b748ecf6
BLAKE2b-256 checksum
How to use checksums
4b7c9440eac5602ff09df998220e403016c07d7f64cb6cf7cbdad8cef0fe882e
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 30, 2026.

Transparency log

Release files / rand_engine-0.8.1-py3-none-any.whl

Download URL rand_engine-0.8.1-py3-none-any.whl
Size 70.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d65b4fb766cbcaad3598bebb11a83e627ddf01edf1fb15eb891009854124904
BLAKE2b-256 checksum
How to use checksums
89631931a9045768036e98be36f54ad4742c8ea96da803cfb5234186160615c5
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 30, 2026.

Transparency log

Security for rand-engine 0.8.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 rand_engine-0.8.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 30, 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.

Release history Release notifications | RSS feed

This release

0.8.1 This release

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