De-identify CSV
Pass a CSV, get a de-identified CSV. Same method handles .xlsx and .xls.
customers.csv
name,email,phone,notes
Jane Smith,jane.smith@example.com,(415) 555-0123,Requested a follow-up call.
Alex Chen,alex.chen@example.com,(212) 555-0198,Interested in enterprise support.
- Python
- TypeScript
from custodian_labs import GuardianLayer
result = GuardianLayer().deidentify_file(
"customers.csv",
masking_type="transform",
pii_entities=["PERSON", "EMAIL_ADDRESS", "PHONE_NUMBER"],
)
with open(result.filename or "deid_customers.csv", "wb") as f:
f.write(result.content)
import { writeFile } from "node:fs/promises";
import { GuardianLayer } from "@custodianlabs/sdk";
const result = await new GuardianLayer().deidentifyFile("customers.csv", {
maskingType: "transform",
piiEntities: ["PERSON", "EMAIL_ADDRESS", "PHONE_NUMBER"],
});
await writeFile(result.filename ?? "deid_customers.csv", result.content);
Swap redact for ***** output. Omit pii_entities (or ["ALL"]) to process
everything.