FastPII
Protect sensitive information before it reaches AI.
FastPII is an open-source privacy engine that detects, validates, and transforms PII. Deterministic, local, and fast.
Documentation · PyPI · Discussions · Contributing
Install
pip install fastpii
Quick Start
from fastpii import FastPII, DEFAULT_PRIORITY
from fastpii.countries.cz import CzechPack
engine = FastPII(priority=DEFAULT_PRIORITY)
engine.register(CzechPack())
result = engine.detect("Jan Novák, RČ: 800101/1238, IČO: 25596641")
for f in result.findings:
print(f"{f.type}: {f.value} ({f.confidence:.0%})")
CLI:
fastpii detect "Jan Novák, RČ: 800101/1238" -r cz
Why FastPII
- Built for AI designed for LLM prompts, RAG pipelines, and AI agents
- Deterministic no LLM calls, no cloud dependency, <1ms per detection
- Country-aware checksum validation for official identifiers (Rodné číslo, PESEL, Steuer-ID, SIREN)
- Self-hosted zero external dependencies, runs locally
- Open Source Apache 2.0, fully auditable
Features
- Detect find PII in text with context-aware detection
- Validate verify identifiers with checksum algorithms
- Anonymize replace PII with
[REDACTED] - Redact replace PII with type labels like
[EMAIL] - Mask replace PII with asterisks
- Remove delete PII entirely
- FastAPI drop-in REST API
- LangChain anonymizer and filter for LLM chains
- MCP Model Context Protocol for AI agents
- CLI command-line detection and validation
Country Support
Production
🇨🇿 Czech Republic 15 detectors with checksum validation
Beta
🇵🇱 Poland PESEL, NIP, REGON, phone, postal code, address
🇩🇪 Germany Steuer-ID, USt-IdNr, Handelsregister, phone, postal code, address
🇫🇷 France SIREN, SIRET, INSEE/NIR, phone, postal code, address
Integrations
from fastpii.integrations.fastapi import create_app
from fastpii.integrations.langchain import PIIAnonymizer
from fastpii.integrations.mcp import MCPServer
Architecture
Your Application
↓
FastPII
↓
Your AI
You configure. It executes. Explicit registration, no hidden defaults.
Documentation
- Getting Started
- API Reference
- Country Packs
- Benchmarks
- Examples
- Architecture
- Migration Guide
- Contributing
- Changelog
Ecosystem
- FastPII Core this repository, Apache 2.0
- Country Intelligence Packs extended data and detection for more countries
- FastPII Secure Chat hosted privacy-first AI chat
- FastPII Enterprise governance, audit trails, compliance
Community
Contributing
Contributions welcome. Country packs, validators, benchmarks, and documentation.
See CONTRIBUTING.md for setup and guidelines.
License
Apache 2.0. See LICENSE.
Privacy should be a default, not an afterthought.
Metadata
Release files for fastpii 0.5.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 |
|---|---|---|---|---|
| fastpii-0.5.0.tar.gz | 375.6 kB | Without provenance | Details for fastpii-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastpii-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for fastpii-0.5.0-py3-none-any.whl |
Total release size: 754.5 kB
Release files / fastpii-0.5.0.tar.gz
| Download URL | fastpii-0.5.0.tar.gz |
|---|---|
| Size | 375.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffc7b0dbbe806a189f9a2ab16ebf0df6bf39d7c7660a3c285b9ce7daed1048a1
|
|
BLAKE2b-256 checksum How to use checksums |
ccc2afe189b83b6a79182e14658c51fc52405511bb94fe6afd412a91f9b889cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Release files / fastpii-0.5.0-py3-none-any.whl
| Download URL | fastpii-0.5.0-py3-none-any.whl |
|---|---|
| Size | 378.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b19447968186591dbba4cc746c9713d0ce52e3789d4e0f41d39291bfacfd37d3
|
|
BLAKE2b-256 checksum How to use checksums |
b1f14d3694d0920d9b700c16e61409be94db85f75143fa062047fc1c218aecd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Security for fastpii 0.5.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.