SDSA
Secure Data Sanitization App (SDSA) is a self-hostable tool for sanitizing tabular data before it leaves a trusted environment.
It ingests CSV, delimited TXT, and single-table SQL INSERT dumps; detects
likely sensitive fields; applies explicit per-column privacy policies; enforces
k-anonymity; measures or enforces l-diversity for sensitive cleartext
attributes; and exports a sanitized CSV with JSON and Markdown privacy reports.
Install
pip install sdsa
sdsa start
Open http://127.0.0.1:8000/.
What It Does
- Serves a browser UI and REST API from one FastAPI application.
- Detects likely PII such as email, phone, card number, government ID, date of birth, name, address, and identifier fields.
- Supports
retain,mask,hash,tokenize,redact,drop,numeric_bin,date_truncate,string_truncate, anddp_laplaceactions. - Applies bounded Laplace noise to numeric columns when differential privacy is
configured with explicit
epsilon,lower, anduppervalues. - Tracks cumulative per-column DP epsilon for the uploaded session to prevent repeated noisy releases from being averaged.
- Enforces k-anonymity over selected quasi-identifiers and can enforce l-diversity on sensitive cleartext attributes.
- Provides preflight suppression estimates before processing.
- Runs headlessly with
sdsa processfor CI/CD and data pipelines. - Stores uploaded data in memory with a default 30-minute session TTL.
CLI
sdsa start
sdsa start --host 0.0.0.0 --port 8000
sdsa start --random-port
sdsa start --reload
# Batch mode: no server, writes sanitized CSV + JSON/Markdown reports.
sdsa process data.csv --out-dir ./sanitized -k 5
sdsa process data.csv --policy request.json --out-dir ./sanitized
sdsa-server remains an equivalent compatibility alias. The package includes
the static frontend, so no separate web build is required.
Privacy Model
SDSA produces pseudonymized microdata with optional per-column local-DP style
noise. It does not claim dataset-level (epsilon, delta) differential privacy.
Linkage attacks using auxiliary data may still succeed.
k-anonymity bounds prosecutor re-identification risk to at most 1/k for the
declared quasi-identifier set, subject to the limits described in each generated
privacy report.
l-diversity is measured by default for cleartext non-QI attributes and can be
enforced with l >= 2. Homogeneous sensitive groups appear as warnings in the
report when l-diversity is measured but not enforced.
Reports also include an information-loss utility score. Downloadable reports strip exact source-side cardinalities, null counts, and numeric bounds while retaining enough metadata to audit field treatment.
Deployment
For production, run sdsa start behind TLS termination and keep one SDSA
process per deployment unless you replace the in-memory session store with
shared infrastructure. The GitHub repository includes Docker, Compose, nginx,
and CI/CD examples.
Links
- Source: https://github.com/defai-digital/sdsa
- Documentation: https://github.com/defai-digital/sdsa/blob/main/README.md
- Deployment guide: https://github.com/defai-digital/sdsa/blob/main/docs/deployment.md
- Privacy model: https://github.com/defai-digital/sdsa/blob/main/docs/privacy-model.md
Metadata
Release files for sdsa 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sdsa-1.2.1.tar.gz | 88.5 kB | Without provenance | Details for sdsa-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sdsa-1.2.1-py3-none-any.whl | Python 3 | none | any | Details for sdsa-1.2.1-py3-none-any.whl |
Total release size: 164.8 kB
Release files / sdsa-1.2.1.tar.gz
| Download URL | sdsa-1.2.1.tar.gz |
|---|---|
| Size | 88.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30e23e75fb7baa9b2cd62e7b5053b359d6ce1a599a2fb1773ec7c8ff5373dbac
|
|
BLAKE2b-256 checksum How to use checksums |
2009cad24947e1d777771bec2492e07de22681781a82bdc47bf2aaa70a3e4c22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / sdsa-1.2.1-py3-none-any.whl
| Download URL | sdsa-1.2.1-py3-none-any.whl |
|---|---|
| Size | 76.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
888a9733defd37487fe6394b88b93c59bb0d6273ed4f3273f2c4df47e455494a
|
|
BLAKE2b-256 checksum How to use checksums |
afb088a8b43def6dcd1907c9aca82185e2933a7e265c3eb4f033f0a594cc8335
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for sdsa 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.