Skip to main content

General purpose tool to process data from S3 and anonymize fields containing personally identifiable information.

Project description

droppii

Droppii is a python module to process data from an AWS (S3) bucket and anonymize personally identifiable information non-recursively, returning data in the same format as provided.

Droppii intends to remove values from top-level columns only, any nested objects or string representations of objects will not be processed.

example with "email" as key:

_id email contacts
1 *** {name: "Sue", email:exposed@email.com}
2 *** {name: "Alan, email:pii@email.com}

CLI usage

droppii can be used from the commandline by invoking the python module directly:
python -m droppii -i s3 uri -k key1 key2 ... >> output_file

options:
  -h, --help            show this help message and exit
  -i s3 uri, --input s3 uri
                        s3 uri of file to be converted
  -k KEYS [KEYS ...], --keys KEYS [KEYS ...]
                        Keys to censor

Quickstart

Install droppii from PyPi

pip install droppii

Most users will only need to use droppii.censor, which takes a JSON string in the format of {s3_uri:"s3://...", private_keys:["key1", "key2"]} and returns a file-like bytes in the same format as file at the s3 location provided.

Currently supports csv, json or parquet file format as input.

usage example

import json

import droppii
import boto3

json_params = json.dumps({
    "s3_uri" = "s3://your-bucket/your_file.csv",
    "private_keys" = ["name", "address", "email_address"]
})
anonymized_bytes = droppii.censor(json_params)

s3client = boto3.Client("s3")
s3client.put_object(
    Bucket = "your-destination-bucket",
    Key = "anonymized_file.csv",
    Body = anonymized_bytes
)

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

droppii-1.0.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

droppii-1.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file droppii-1.0.0.tar.gz.

File metadata

  • Download URL: droppii-1.0.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for droppii-1.0.0.tar.gz
Algorithm Hash digest
SHA256 313d42354e4edf840c375736f2d1124bd54ad55fba9b07b828ea758b73c5e9d7
MD5 15e0c6574dbe9a87bc3729d3b554f1b1
BLAKE2b-256 1efbd68517556b89e6874b021037813d63aed7668f67cac8affe0754f70d6156

See more details on using hashes here.

File details

Details for the file droppii-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: droppii-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for droppii-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6754fd816b991b0fb85fe44b0cd9b2b05811b98c09e1f0a92ece449dcffee8ff
MD5 b12025ccccc2fa89aceac4f61a3ee10d
BLAKE2b-256 c671c17884539c9b80a147fdd7ae5798be089aa90bb2fd12787047e05be9d67f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page