Datanymizer is a database anonymizer that reads a live database, applies configurable transformation rules, and writes a native SQL dump with sensitive fields replaced by fake values.
Overview
Datanymizer helps teams produce shareable or non-production copies of database data without exposing real personal or sensitive values. You inspect the schema, mark sensitive columns, and define rules in a YAML config. The pgdatanymizer CLI connects to a database instance, dumps schema and data, and substitutes values using built-in generators and templates.
Output is a database-native SQL dump you can import with standard tools, similar in spirit to pg_dump pipelines. The dumper can write to a file or stream to standard output for use in shell pipelines. PostgreSQL is the supported database; other engines are listed as planned work.
Configuration covers table and schema filters with wildcards, SQL WHERE conditions and row limits per table, and separate transform conditions so only matching rows are anonymized. More than seventy rule types cover emails, names, phones, passwords, dates, IPs, and composable template pipelines. Rules can enforce uniqueness, use locales, reference other columns in the same row, and share state across rows via a built-in key-value store.
Optional SQL assertions run before dumping to validate source data, with warn or error severity. Install via pre-built binaries, Homebrew or Linuxbrew, or Docker images tagged for specific PostgreSQL versions.
Key features
- YAML-driven field transformation rules
- Native PostgreSQL SQL dump output
- Table include and exclude filters with wildcards
- Per-table dump, transform conditions, and limits
- SQL assertions before dump generation
- Locales, uniqueness, and cross-row template references
- Stream dumps to stdout for pipelines
- Docker images per PostgreSQL version
Use cases
- Anonymizing production data for staging environments
- Creating demo datasets from real schemas
- Sharing database samples without sensitive fields
- Validating data preconditions before export
Does the same job as
Datanymizer doesn't name these products itself, but its own description shows it does the same job.