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.2.0.tar.gz (8.3 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.2.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for droppii-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8e85980376ecf175f7d8229dfd66d388ad65e0e7a03664f995a6a2c8fefcba30
MD5 4463ce1bd97957ffe61b029cca83825a
BLAKE2b-256 c039ecd0c2da84c0a6c2924b08739711fc7fe71bac6882ac05fd207f378b2d0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: droppii-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b41b1a2befe25d4178da997da0164a06807ec121f5746dff8207000217f7174f
MD5 d3fffd7daaaec1b80c1b22a509716200
BLAKE2b-256 b254e360d59c328902f1463f637c539df95a360738ea757737a5f1fdef07bfe6

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