Skip to main content

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.

PyPI Python License Docs

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

Country documentation →


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


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

https://fastpii.com


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)

Source distribution for fastpii 0.5.0
File Size Uploaded
fastpii-0.5.0.tar.gz 375.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastpii 0.5.0
File Interpreter ABI Platform
fastpii-0.5.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page