Polars · PII Masking

Polars PII Masking in One Line of Python

Detect and redact names, emails, phone numbers, SSNs, MRNs, and free-text PHI across every column of a Polars DataFrame — locally, with a Rust kernel, in a single call.

The one-line API

import polars as pl
import omna

df = pl.read_parquet("patient_notes.parquet")

# Detect + redact PII across every text column (patterns + 220+ secret rules).
masked = df.omna.mask_pii()

# Add the on-device AI model for contextual PII (bare names, addresses).
masked = df.omna.mask_pii(model=True)

Why local matters

Most PII redaction tools (AWS Comprehend, Google DLP, Azure PII) require shipping the raw records to a cloud API. For healthcare, finance, and government workloads, that means a BAA, a vendor review, and a new line item in your data flow diagram. Omna runs in your Python process. Zero network calls. No BAA required, because nothing leaves the host.

A six-layer engine, not a regex

Omna's masking is the same Rust engine that powers the Omna Mac app and browser extension: patterns + checksum-validated IDs, 220+ secret rules, an optional on-device AI model for contextual PII, entity resolution, reversible tokens (secrets are always redacted irreversibly), and a full audit trail.

30+ data types, plus 220+ secret kinds

Try it now

pip install omna

The live playground runs a real mask_pii() call on a sample healthcare dataset, in your browser.