PGAnonymizer
PGAnonymizer is a tool for anonymizing database for testing purposes.
Installation
PGAnonymizer required Python 3.5 and above to run. PGAnonymizer can be installed using pip.
$ pip install pganonymizer
Background
PGAnonymizer will hash columns in table depending on the rules inside CSJ file.
CSJ file format:
"table", "column", "rule"
"schema.table_to_be_hased", "columned_to_be_hased", "hash"
"schema.table_to_be_hased", "columned_to_be_hased", "date"
"schema.table_to_be_hased", "columned_to_be_hased", "phone"
Example for rules for hashing
Hash is for text type field such as name or address. The return value will be in base32 with length of atmost 16.
Example input:
Customer1
Example output:
EC35FEOXDMVR7Y5C
Date is for date type field. The return value will keep the original year but hash the month and date field.
Example input:
2000-12-15
Example output:
2000-01-10
Phone is for phone number. The return value will be of same length as the original number.
Example input:
+66932019385
Example output:
+66254818000
Instruction
Format:
$ pganonymizer [database environment] [option]
To use PGAnonymizer, you can call:
$ pganonymizer --schema path_to_schema_file.csj
By default, PGAnonymizer will connect to database using user's username as database and role.
Otherwise, please specify as follow:
$ pganonymizer -d postgres -U postgres --schema path_to_schema_file.csj
For more information on the usage, please use the following command:
$ pganonymizer --help
Metadata
Release files for pganonymizer 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pganonymizer-0.0.5.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pganonymizer-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.1 kB
Release files / pganonymizer-0.0.5.tar.gz
| Download URL | pganonymizer-0.0.5.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e988e699326d41b8e43fb086964743164269e47aa5f2f899066c9fe2d0e9b2ec
|
|
BLAKE2b-256 checksum How to use checksums |
7533bcbc6a9d44db5898fac79d77a4d0f1b5c69c75176ff22b23bd2cc34e2c26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Release files / pganonymizer-0.0.5-py3-none-any.whl
| Download URL | pganonymizer-0.0.5-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a48015ce228caa42fe2257e659753eb4d2ef38879221ca1832bc673ab8be556
|
|
BLAKE2b-256 checksum How to use checksums |
ce89afb9851f7e486cd6d8ca3a52af3435b01c15c35a8180b7f2d42f7805a08c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|