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

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.4
File Size Uploaded Provenance Actions
pganonymizer-0.0.4.tar.gz 4.8 kB Without provenance Details for pganonymizer-0.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 12.1 kB

Release files / pganonymizer-0.0.4.tar.gz

Download URL pganonymizer-0.0.4.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1d90563088fd058a4d0476eec949440f8733e806962bf1db267152b466174890
BLAKE2b-256 checksum
How to use checksums
a9dea0fa262a4db7d09d6df61615132d695e5d0a1b10f54b0a4378bad4272ee0
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.4-py3-none-any.whl

Download URL pganonymizer-0.0.4-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d939197ef17d8d9aa4482c20ba9496f463fa1d299752df49fbde091f8b9a1f9c
BLAKE2b-256 checksum
How to use checksums
89423d8814c419a1e8b6e569fb325f6751a5a0d01d6c501ad6fdaaa38e904994
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.4

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