Metadata-Version: 2.4
Name: schema-to-synth
Version: 0.1.0
Summary: Synthetic data from your schemas. FK-aware, air-gapped, 100-row cap.
Author: Luigi
License-Expression: Elastic-2.0
Keywords: synthetic-data,test-data,data-generation,fake-data,openapi,sql,faker
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Testing :: Mocking
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: sqlglot>=23.0
Requires-Dist: faker>=24.0
Requires-Dist: click>=8.1
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Dynamic: license-file

# synthgen

Turn a schema into synthetic data. Point at a `.sql` file or an OpenAPI
spec, get back realistic rows with foreign keys that resolve, semantic
hints (emails stay `@example.com`, phones stay in the NANP fictional
range), and a signed manifest so the output can't be mistaken for real
production data later.

```
pip install schema-to-synth
```

Then:

```bash
synthgen generate --schema schema.sql --rows 100 --out out/
```

## Quickstart

```bash
# Generate 100 rows per table from a SQL DDL file.
synthgen generate --schema schema.sql --rows 100 --out out/

# Same, but JSON output.
synthgen generate --schema schema.sql --rows 100 --out out/ --format json

# From an OpenAPI spec.
synthgen generate --openapi petstore.yaml --rows 50 --out out/

# With per-column overrides (weights, bounds).
synthgen generate --schema schema.sql --overrides my.yaml --rows 100 --out out/
```

Reproducible with `--seed`, strict-by-default policy (no network calls
ever), and a `.synthgen_manifest.json` written to every output directory
carrying the SHA-256 of your schema and a `"SYNTHETIC"` classification
tag.

## What's included

- SQL DDL ingester (every major dialect via sqlglot)
- OpenAPI 3.x / Swagger 2.0 ingester
- Schema-only generation with foreign-key integrity
- Composite primary-key uniqueness
- Semantic hints — emails, phones, addresses rendered in reserved ranges
- CSV / JSON output
- Per-column overrides: weighted values, numeric/date bounds, null rate
- Per-table row counts via overrides
- Signed provenance manifest
- Reproducible with `--seed`
- Capped at 100 rows per table

## What's not in this edition

Features present in the code but reserved for a full edition in
development — invoking them exits cleanly with a "not included in this
edition" message:

- Preset library (`ecommerce`, `saas`, `fintech`)
- Joint groups (coherent `state × country` pairs)
- Reference-CSV joint groups
- Live-API probe modes (fingerprint / sample)
- Streaming output (10M+ rows without OOM)
- Parquet output
- Calibration (per-column KS/TV, cross-column joints, correlation)
- HMAC-signed audit logs
- Row counts above 100 per table

## Security posture

- **Air-gapped.** No network calls, period. The code to probe live APIs
  is not shipped in this edition.
- **Synthetic data is classified.** Every manifest records
  `"classification": "SYNTHETIC — not personal data"` so downstream
  pipelines don't accidentally treat the output as PII.
- **Emails end in `@example.com`.** (RFC 2606 reserved domain.)
- **Phones are in the `555-01xx` range.** (NANP fictional block.)
- **Composite PKs stay unique**; FK references always resolve to a
  real parent row.

## License

Elastic License 2.0 — see [LICENSE](./LICENSE).

You can read, use, modify, and redistribute this software for your own
purposes. You cannot provide it as a hosted or managed service to third
parties, and you cannot remove or circumvent license-key functionality.
See the license text for the full terms.

## Project status

v0.1.0 — first public release.
