Skip to main content

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.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pganonymizer 0.0.3
File Size Uploaded Provenance Actions
pganonymizer-0.0.3.tar.gz 4.7 kB Without provenance Details for pganonymizer-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pganonymizer 0.0.3
File Interpreter ABI Platform Actions
pganonymizer-0.0.3-py3-none-any.whl Python 3 none any Details for pganonymizer-0.0.3-py3-none-any.whl

Total release size: 12.0 kB

Release files / pganonymizer-0.0.3.tar.gz

Download URL pganonymizer-0.0.3.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a6f61aacb9be60a02cc27e23b3cd96db7ba5284c52cb0afd0089320d046226a5
BLAKE2b-256 checksum
How to use checksums
ad47e143abf0b0d97cd0fea92aa1744efe60a3c599bbffb38f743fd16e031e32
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.3-py3-none-any.whl

Download URL pganonymizer-0.0.3-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c291df6643bea5f97f2d4e747cb989974ea75cb424189099f732b1e1bc354eb
BLAKE2b-256 checksum
How to use checksums
e1b84a9cc0f817ce5595380a2598785dd0a785e3259d43f2c8cb6f8d45d97dc4
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

Security for pganonymizer 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page