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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastpii-0.5.0.tar.gz.
File metadata
- Download URL: fastpii-0.5.0.tar.gz
- Upload date:
- Size: 375.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffc7b0dbbe806a189f9a2ab16ebf0df6bf39d7c7660a3c285b9ce7daed1048a1
|
|
| MD5 |
4bb5919ecad55a0565aa2f6b8a1f1075
|
|
| BLAKE2b-256 |
ccc2afe189b83b6a79182e14658c51fc52405511bb94fe6afd412a91f9b889cf
|
File details
Details for the file fastpii-0.5.0-py3-none-any.whl.
File metadata
- Download URL: fastpii-0.5.0-py3-none-any.whl
- Upload date:
- Size: 378.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b19447968186591dbba4cc746c9713d0ce52e3789d4e0f41d39291bfacfd37d3
|
|
| MD5 |
718b0b37b05d5313dcaad6fa8b93b6e2
|
|
| BLAKE2b-256 |
b1f14d3694d0920d9b700c16e61409be94db85f75143fa062047fc1c218aecd8
|