An anonymization tool for production databases
Project description
pynonymizer
pynonymizer is a tool for translating sensitive production database dumps into anonymized copies.
This anonymized data can be used in development and testing.
Supported Databases
- mysql
Requirements
mysql
mysql
mysqldump
- database connection (to restore, anonymize, and dump from)
- access to mysqldump file (single file)
Process
- Restore database from dumpfile
- anonymize database with appropriate strategy
- dump resulting data to file
- clean up!
Getting Started
Usage
- Set required env (normally, or using dotenv)
- Write a strategyfile for your database
- Run command
pynonymizer
usage: pynonymizer [-h] [--db-name DB_NAME] [-v] input strategyfile output
A tool for writing better anonymization strategies for your production databases.
environment variables:
DB_TYPE Type of database (mysql)
DB_HOST Database host/ip (127.0.0.1)
DB_USER Database username
DB_PASS Database password
FAKE_LOCALE Locale to initialize faker generation (en_GB)
positional arguments:
input The source dumpfile to read from.
[.sql, .gz]
strategyfile A strategyfile to use during anonymization.
output The destination to write the dumped output to.
[.sql, .gz]
optional arguments:
-h, --help show this help message and exit
--db-name DB_NAME, -n DB_NAME
Name of database to create in the target host and restore to. This will default to a random name.
-v, --version show program's version number and exit
Development
- setup venv
- install dependencies with
pip install -r requirements.txt
Testing
- run
tox
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pynonymizer-1.1.2.tar.gz
(10.7 kB
view hashes)
Built Distribution
Close
Hashes for pynonymizer-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c6f3debd1af15e242d6542d51d44be86e71469bdeda46d5bee7b95e59b0f7a8 |
|
MD5 | b814e690426ebc5e5102fc1d76c37988 |
|
BLAKE2b-256 | cc49561d6e3e9d52dc6d7ac27334eec926f77f5e45c44abf41568a6776be3682 |