Sitelet https://spacexnu.github.io/ShadowData/
Skip to content

ShadowData

A Python library for anonymizing, masking, and encrypting sensitive data with a small, focused API.

Get started View on GitHub

What it does

At a glance

from shadow_data import (
    EmailAnonymization,
    Pseudonymizer,
    UsaIdentifierAnonymizer,
    mask_credit_card,
)

EmailAnonymization.anonymize_email('user@example.com')  # '****@****ple.com'
UsaIdentifierAnonymizer('SSN: 479-92-5042').anonymize()  # 'SSN: XXX-XX-5042'
mask_credit_card('4111 1111 1111 1111')  # '**** **** **** 1111'

pseudonymizer = Pseudonymizer()
token = pseudonymizer.pseudonymize('user@example.com')
pseudonymizer.depseudonymize(token)  # 'user@example.com'

Not sure which one you need?

The techniques differ in whether the original value can be recovered and in how much of it remains readable. Choosing a technique walks through the trade-offs.

Project status

ShadowData requires Python 3.10 or newer, ships type information (py.typed), and is checked with mypy in strict mode. It is released under the MIT License.