pynonymizer may be useful to you as a complete process or in part. For example, you might not want the database to be dropped at the end of the process, so you can query it later.
Pynonymize offers a few of options for controlling the process.
--start-at STEP Choose a step to begin the process (inclusive).
[$PYNONYMIZER_START_AT]
--skip-steps STEP [STEP ...]
Choose one or more steps to skip.
[$PYNONYMIZER_SKIP_STEPS]
--stop-at STEP Choose a step to stop at (inclusive).
[$PYNONYMIZER_STOP_AT]
--only-step STEP Choose one step to perform.
[$PYNONYMIZER_ONLY_STEP]
Pynonymizer's process is broken into steps:
START
: NOOP action, firstCREATE_DB
: Create the named databaseRESTORE_DB
: Restore the database from inputANONYMIZE_DB
: Run the anonymization processDUMP_DB
: Dump the database to outputDROP_DB
: Drop the named databaseEND
: NOOP, last
Essentially: steps can be run, or they can be skipped.
There are a few ways a step can be skipped:
--start-at
is set to a value after the current step--stop-at
is set to a step before the current step--skip-steps
includes the current step--only-step
does not include the current step.
If a step is skipped it will be logged as a warning, but the process will complete successfully as long as the remaining steps do.
- Keep a database afer anonymization:
pynonymizer [...] --stop-at DUMP_DB
- Anonymize
pynonymizer [...] --db-name sakila --only-step ANONYMIZE_DB
- Restore
pynonymizer [...] --db-name sakila --only-step RESTORE_DB