Skip to main content

📝 avro-datagen

CI PyPI version License: MIT Python 3.13+ Docs

Schema-driven fake data generator for Avro schemas. Reads .avsc files with arg.properties hints and produces realistic records. Includes Faker for names, emails, addresses, and more.

avro-datagen generates data -- nothing more. Pipe JSON output to Kafka, databases, files, or any other sink using the tools you already have.

Install

pip install avro-datagen                 # CLI + library + Faker
pip install "avro-datagen[ui]"           # + Streamlit web UI
pip install "avro-datagen[app]"          # + UI + Kafka producer (for interactive testing)

Web UI

pip install "avro-datagen[ui]"
avro-datagen ui

Opens a Streamlit dashboard at localhost:8501 with a bundled example schema. Browse schemas, edit them live, preview generated data, and download samples.

The UI creates a schemas/ folder in your working directory when you save a schema. Point --schema-dir at an existing folder to use your own schemas.

avro-datagen ui --schema-dir ./my-schemas      # use your own schemas
avro-datagen ui --port 3000                    # custom port
avro-datagen ui --kafka                        # enable Kafka producer section

CLI

# Create a schema file
cat > order.avsc << 'EOF'
{
  "type": "record",
  "name": "Order",
  "fields": [
    { "name": "id", "type": { "type": "string", "logicalType": "uuid" } },
    { "name": "amount", "type": "double", "arg.properties": { "range": { "min": 5, "max": 500 } } },
    { "name": "customer", "type": "string", "arg.properties": { "faker": "name" } }
  ]
}
EOF

# Generate 10 records
avro-datagen -s order.avsc

# Pretty-print, seeded for reproducibility
avro-datagen -s order.avsc -c 5 --seed 42 --pretty

# Rate-limited, infinite
avro-datagen -s order.avsc -c 0 --rate 10

# ISO-8601 timestamps instead of the Avro wire encoding, for pasting into
# a Kafka UI produce form
avro-datagen -s order.avsc -c 5 --json-format human

Library

from avro_datagen import generate

for record in generate("order.avsc", count=100):
    print(record)

# Deterministic output
records = list(generate("order.avsc", count=10, seed=42))

Sinks and integrations

avro-datagen does not bundle integrations for databases, cloud storage, or message queues. The CLI emits JSON lines to stdout -- pipe it anywhere:

avro-datagen -s schema.avsc -c 1000 | kcat -b localhost:9092 -t topic   # Kafka
avro-datagen -s schema.avsc -c 1000 > data.jsonl                        # File
avro-datagen -s schema.avsc -c 1000 | psql -c "COPY t FROM STDIN"       # Postgres

The Kafka producer in the UI (--kafka) is a convenience for interactive testing, not a production integration.

Development

git clone https://github.com/ConsciousExplorer/avro-datagen.git
cd avro-datagen

With uv (recommended):

uv sync --all-extras

make test       # run tests
make check      # lint + typecheck + tests
make app        # streamlit UI
make docs       # mkdocs dev server

With pip:

python3 -m venv .venv && source .venv/bin/activate
pip3 install -e ".[dev,ui]"
make test

Documentation

Full documentation: consciousexplorer.github.io/avro-datagen

License

MIT

Download files

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

Source Distribution

avro_datagen-0.4.2.tar.gz (150.0 kB view details)

Uploaded Source

Built Distribution

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

avro_datagen-0.4.2-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file avro_datagen-0.4.2.tar.gz.

File metadata

  • Download URL: avro_datagen-0.4.2.tar.gz
  • Upload date:
  • Size: 150.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for avro_datagen-0.4.2.tar.gz
Algorithm Hash digest
SHA256 187298a2092e8f97df5d3b0e8e2c9afad454a1807c6fbc00c1b77a8b0cd7273c
MD5 b4110642fe72df1ee29e9beda41817ec
BLAKE2b-256 98ecaddd4565f22a44950efb33b470aa364bfd9e0a78c1c8a7430a8cb542bc9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for avro_datagen-0.4.2.tar.gz:

Publisher: release.yml on ConsciousExplorer/avro-datagen

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

File details

Details for the file avro_datagen-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: avro_datagen-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for avro_datagen-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 642c52b246f343adc4a15c0ee37848de41345658eafa220d1de83cd1f6250b44
MD5 5d7399c20c1e1c66c2b8e1f096e408fc
BLAKE2b-256 efd15dbc4255beeb1baa815b654febf5265043d30059d9ef665f39e9fd3f7514

See more details on using hashes here.

Provenance

The following attestation bundles were made for avro_datagen-0.4.2-py3-none-any.whl:

Publisher: release.yml on ConsciousExplorer/avro-datagen

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

Release history Release notifications | RSS feed

0.5.0

2 files

This release

0.4.2 This release

2 files

0.4.1

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 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