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-0.1.1.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-0.1.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for droppii-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8d52f5821380030eba2ed12f9cfb72300287cdaaa1d3edd781a48933027557ce
MD5 f6e2accb26f83246e07f9749e52fba73
BLAKE2b-256 f96cfbb23fe2b2db4cb23b5031a1ba7a19ba7dd9ec8c69096ce1506b513e9eb6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for droppii-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d25cefac42955f21a1c18bfae33d193dde19ce916e82469ac32fb330968aca6
MD5 7de3dfff86b9a6ae782e947d84cbb696
BLAKE2b-256 91906d0a3bb1ea95fed3aa51cdd818e71611fa2928c2a5c7546f97b263dca77d

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