Skip to main content

Anonymize CSV datasets

Project description

vendetta

Build Status Python Version wemake-python-styleguide

Anonymize CSV file(s) by replacing sensitive values with fakes.

Installation

pip install vendetta

Example

Suppose you have orders.csv dataset with real customer names and order IDs.

CustomerName,CustomerLastName,OrderID
Darth,Wader,1254
Darth,Wader,1255
,Yoda,1256
Luke,Skywalker,1257
Leia,Skywalker,1258
,Yoda,1259

This list contains 4 unique customers. Let's create a configuration file, say, orders.yaml:

columns:
  CustomerName: first_name
  CustomerLastName: last_name

and run:

vendetta anonymize orders.yaml < orders.csv > anon.csv

which gives something like this in anon.csv:

CustomerName,CustomerLastName,OrderID
Elizabeth,Oliver,1254
Elizabeth,Oliver,1255
Karen,Rodriguez,1256
Jonathan,Joseph,1257
Katelyn,Joseph,1258
Karen,Rodriguez,1259
  • OrderID column was not mentioned in the config, and was left as is
  • Using faker, program replaced the first and last names with random first and last names, making the data believable
  • If in the source file two cells for the same column had the same value (Vader), the output file will also have identical values in these cells.

Enjoy!

License

MIT

Credits

This project was generated with wemake-python-package. Current template version is: b80221aaae4ac702bea7e66b77b9389d527c1e3c. See what is updated since then.

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

vendetta-0.0.2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

vendetta-0.0.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file vendetta-0.0.2.tar.gz.

File metadata

  • Download URL: vendetta-0.0.2.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.6 Linux/5.4.0-72-generic

File hashes

Hashes for vendetta-0.0.2.tar.gz
Algorithm Hash digest
SHA256 322032ba9aeea2c037426e479a897cc58414a67464da5bbc428ec847fb124805
MD5 26e78eeaae4d606974f669beb99ce13a
BLAKE2b-256 dd0aaa206d8aebc6f5fa28e0a65791d7b0d25ed6223b3a3e40331eecfa1c199a

See more details on using hashes here.

File details

Details for the file vendetta-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: vendetta-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.6 Linux/5.4.0-72-generic

File hashes

Hashes for vendetta-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0f62aaf1558eb602e49e91266ad92671c14df085f8d72db5f4365731ba041075
MD5 809d851aefe4fe6c8cf06040a345019d
BLAKE2b-256 f2d87d5ba927dfed1dc4a7b2899fe8549e38135b36d6edf97bbcab120e8d9038

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