kiprio-redact
Local, offline PII redaction in one pipe. Single-file Python CLI. No telemetry, no network calls.
pip install kiprio-redact
echo "ping me at hi@example.com or +44 7700 900123" | kiprio-redact
# ping me at [REDACTED] or [REDACTED]
What it redacts
email, phone, iban, card (Luhn-validated), nino (UK National Insurance, prefix-validated), uuid, jwt, ip (v4 + v6).
Usage
# default: redact every supported type, write to stdout
kiprio-redact < input.txt
# pick types
kiprio-redact -t email,phone,card < input.txt
# mask each char with X (preserves length)
echo "card 4111 1111 1111 1111" | kiprio-redact -m X
# card XXXXXXXXXXXXXXXXXXX
# custom replacement
kiprio-redact -r "<pii>" < input.txt
# structured findings (JSON) instead of redacted text
kiprio-redact --json < input.txt
# files in/out
kiprio-redact -i in.log -o redacted.log
# verbose: count by type to stderr
kiprio-redact -v < big.log > /dev/null
# kiprio-redact: card=2, email=14, ip=3, phone=7 (total=26)
Library use:
from kiprio_redact import redact, find_spans
text = "alice@example.com 4111 1111 1111 1111"
clean, findings = redact(text)
# clean = "[REDACTED] [REDACTED]"
# findings = [{"type":"email","start":0,"end":17,"raw":"alice@example.com"},
# {"type":"card","start":18,"end":37,"raw":"4111 1111 1111 1111"}]
CLI vs API — when to use which
| Use case | CLI (kiprio-redact) |
API (/v1/redact) |
|---|---|---|
| One-off log scrub, dev pipeline | ✅ | overkill |
| Offline, no data leaves your box | ✅ | — |
| Free / unlimited | ✅ | usage-billed |
| Context-aware (names, addresses, ORG) | regex only | ✅ NER + LLM-assisted |
| URLs, custom dictionaries, postcodes | regex subset | ✅ extended catalogue |
| Higher recall on edge cases | — | ✅ |
| Managed: SLA, audit trail, billing | — | ✅ |
The CLI uses the same regex muscles that power the API's regex layer, so a finding here is a finding there. The API adds context-aware detection on top.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 2 | Bad arguments (unknown type, etc.) |
Privacy
kiprio-redact makes zero network calls and writes nothing to disk except the output you ask for. Read kiprio_redact/__init__.py — under 250 LOC, all stdlib.
License
MIT — see LICENSE.
Metadata
Release files for kiprio-redact 0.1.0
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 |
|---|---|---|---|---|
| kiprio_redact-0.1.0.tar.gz | 7.9 kB | Without provenance | Details for kiprio_redact-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kiprio_redact-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for kiprio_redact-0.1.0-py3-none-any.whl |
Total release size: 15.8 kB
Release files / kiprio_redact-0.1.0.tar.gz
| Download URL | kiprio_redact-0.1.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
858dd03cca287dd0411ff67b791873404d29c827e205197988f3ceece9cf633f
|
|
BLAKE2b-256 checksum How to use checksums |
d5b562c78bd689f11c4d4381656992bbaa8139998614fe6f1c07d639ab65c6a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / kiprio_redact-0.1.0-py3-none-any.whl
| Download URL | kiprio_redact-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c12a5e7a899223a26c38bceb52fc2be16e774afe6b73f07a144d969e754e827d
|
|
BLAKE2b-256 checksum How to use checksums |
2fa2845cf4c546310262fab5960aa113356490ee272f3aba9ef168c1c4dafa8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for kiprio-redact 0.1.0
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.