Fast structured PII detection, implemented in Rust and exposed for Rust, Python, Node.js, and browsers.
It detects EMAIL, PHONE, SSN, CREDIT_CARD, IP_ADDRESS, DATE, and ZIP_CODE. Every binding returns the same entity shape:
label, text, start, end
start and end are zero-based Unicode code-point offsets; end is exclusive.
| Runtime | Distribution | Import | Status |
|---|---|---|---|
| Rust | datafog-core |
datafog_core |
Published |
| Python | datafog-core |
datafog_core |
Published |
| Node.js | @datafog/node |
@datafog/node |
npm release pending |
| Browser/WASM | @datafog/wasm |
@datafog/wasm |
npm release pending |
cargo add datafog-coreuse datafog_core::scan;
let entities = scan("Email jane@example.com");
assert_eq!(entities[0].label, "EMAIL");
assert_eq!(entities[0].text, "jane@example.com");python -m pip install datafog-corefrom datafog_core import scan
entities = scan("Email jane@example.com")
print(entities[0].label) # EMAIL
print(entities[0].text) # jane@example.com@datafog/node will install as a native package once its npm release is published.
import { scan } from "@datafog/node";
console.log(scan("Email jane@example.com"));The release includes prebuilt binaries for macOS (Intel and Apple Silicon), Linux (x64 and ARM64), and Windows x64.
@datafog/wasm will install from npm once its first release is published.
import { init, scan } from "@datafog/wasm";
await init();
console.log(scan("Email jane@example.com"));cargo test --workspaceTo exercise an installed binding package locally:
npm ci --prefix bindings/node
npm run test:package --prefix bindings/node
rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli --version 0.2.127 --locked
npm ci --prefix bindings/wasm
npx --prefix bindings/wasm playwright install chromium
npm run test:package --prefix bindings/wasmcrates/core/ Rust scanning library
bindings/python/ Python extension
bindings/node/ Node.js native binding
bindings/wasm/ Browser/WASM binding
fixtures/ Shared conformance fixtures