Skip to main content

Synthetic multi-party dataset generator for data clean room testing

Project description

Dhara

Synthetic multi-party dataset generator for data clean room testing.

Reap what you sow.


What is Dhara?

Data clean room tests fail not because the infrastructure is wrong — but because the test data is wrong.

Nulls, mismatched IDs, unrealistic distributions, and uncontrolled overlap rates make clean room query results meaningless during development. Dhara solves this at the source.

Given a use case configuration, Dhara generates N CSV files — one per data partner — where:

  • Each file has a match ID column — SHA-256 hashed (hashed_email, hashed_phone, hashed_customer_id) or UUID v4 (device_id / IDFA / GAID)
  • Cross-file ID overlap is mathematically controlled via a pairwise match rate matrix (inclusion-exclusion algorithm)
  • Column values follow your defined distributions — weighted categorical, integer, decimal, boolean, date, datetime, email, free text
  • Nullable percentages are respected per column
  • Achieved match rates are verified post-generation and reported in metadata.json
  • Participant schemas can be imported from a pasted CSV sample or JSON column list — types, distributions, and value weights inferred automatically
  • All runs are reproducible via a seed

Quickstart

Web UI (Docker)

docker pull pn3uma7/dhara
docker run -p 8080:8080 pn3uma7/dhara
# Open http://localhost:8080

CLI

pip install vasundhara
dhara init                                          # interactive config builder → usecase.json
dhara generate --config usecase.json                # generate datasets → ./dhara_output/
dhara generate --config usecase.json --seed a3f9    # reproduce an exact run

How it works — 5 steps

Step What you do
1 Use Case Name your scenario, choose match ID type, set number of partners
2 Participants Import each partner's schema from a CSV sample or JSON, or build manually
3 Match Rates Set pairwise overlap % — drag sliders, see absolute pool sizes live with industry benchmarks
4 Review Run the Audience Simulator — see how filters reduce the shared pool before generating
5 Generate Download a ZIP: one CSV per partner + metadata.json with match rate verification

Example use case

Three-way clean room intersection: Brand × Publisher A × Publisher B

Match rates:  Brand ∩ Pub-A = 20%,  Brand ∩ Pub-B = 15%,  Pub-A ∩ Pub-B = 10%
All-3 overlap: 5%

Brand query:    WHERE segment = 'premium' AND recency = 'active'
Pub-A query:    WHERE content_vertical = 'finance'
Pub-B query:    WHERE device_type = 'mobile'

→ Shared pool before filters: ~150,000 IDs
→ After all three filters:    ~18,000 – 25,000 IDs

See examples/monster_doordash_walmart.json for a complete ready-to-run config.


Features

Match ID types

Type Format Use case
hashed_email SHA-256 hex Email-based clean rooms
hashed_phone SHA-256 hex SMS / mobile targeting
device_id UUID v4 (IDFA / GAID) Mobile app audiences
hashed_customer_id SHA-256 hex CRM / loyalty ID matching

Column types

Categorical · Integer · Decimal · Boolean · Date · Datetime · Email · Free Text

Schema inference

Paste a CSV sample → Dhara infers column types, value distributions, and weights from actual frequency data. Match key columns are auto-detected and skipped.

Audience Simulator

Before generating, simulate a clean room query: apply one filter per partner and see how many IDs survive — with a per-step funnel and survival rate.

Proportional weight sliders

Drag a categorical value's weight up — others reduce proportionally. Hard 95% cap prevents any one value from owning the entire distribution.

Reproducibility

Every run produces a seed. Re-run with --seed to get byte-identical output.


Output

dhara_run_20260530_143022.zip
├── brand_dataset.csv           ← match ID + column values
├── publisher_a_dataset.csv
├── publisher_b_dataset.csv
└── metadata.json               ← seed, requested vs achieved rates, drift warnings

Tech stack

Layer Technology
Frontend React 18, TypeScript, Tailwind CSS, Ubuntu font
Backend Python 3.11, FastAPI
Data generation NumPy, Pandas, Faker
ID generation hashlib SHA-256, uuid v4
Packaging Docker · PyPI (pip install vasundhara) · typer CLI

Self-hosting

# One-time setup — no auth, no data leaves your machine
docker run -d -p 8080:8080 --restart=always pn3uma7/dhara

# Expose via VPN or internal DNS: dhara.yourcompany.com

Part of the Vasu tool universe. Dhara (धरा) — earth, foundation, the one who holds.

MIT Licence — free to use, self-host, and modify.

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

vasundhara-1.1.1.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

vasundhara-1.1.1-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file vasundhara-1.1.1.tar.gz.

File metadata

  • Download URL: vasundhara-1.1.1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for vasundhara-1.1.1.tar.gz
Algorithm Hash digest
SHA256 cf3e57cb348c4d98bbe9a56299b14ee5e375d344e212b4d5b81255eb90d3c6bd
MD5 d2707c1e6d2f3081fd9a622ae3a38ff7
BLAKE2b-256 d715632ac39bf4f556a7bcf7479c0f05661c43736f4bcaca0e272dcf664edf03

See more details on using hashes here.

File details

Details for the file vasundhara-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: vasundhara-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for vasundhara-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ff673c6d21a2448e5fe9ce61ff2cb291cb8039f1dfcc770df7b259acaa5b380
MD5 a5d8e9996d17efeb91acfbb2d31eea4f
BLAKE2b-256 949d34f09d715ee611509f12ce3495cf7fca5f47583e5f3c911e011db750dff1

See more details on using hashes here.

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