Skip to main content

Database anonymizer package

Project description


PGAnonymizer is a tool for anonymizing database for testing purposes.


PGAnonymizer required Python 3.5 and above to run. PGAnonymizer can be installed using pip.

$ pip install git+


PGAnonymizer will hash columns in table depending on the rules inside CSJ file.

CSJ file format:

"table", "column", "rule"
"table_to_be_hased", "columned_to_be_hased", "rule_for_hashing"
"table_to_be_hased", "columned_to_be_hased", "rule_for_hashing"
"table_to_be_hased", "columned_to_be_hased", "rule_for_hashing"

Example for rules for hashing

Hash is for text type field such as name or address. The return value will be atmost 16 bytes Example input:


Example output:


Date is for date type field. The return value will keep the original year but hash the month and date field. Example input:


Example output:


Phone is for phone number. The return value will be of same length as the original number. Example input:


Example output:



To use PGAnonymizer, you can call:

$ pganonymizer --schema path_to_schema_file.csj

For more information on the usage, please use the following command:

$ pganonymizer --help

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

pganonymizer-0.0.2.tar.gz (3.8 kB view hashes)

Uploaded source

Built Distribution

pganonymizer-0.0.2-py3-none-any.whl (5.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page