ezpiizi
Reversible PII pseudonymisation for French / Moroccan banking assistants. The LLM only ever sees
placeholders (<PERSON_1>, <MA_IBAN_1>); tools, storage and the customer keep the real values.
"Je suis Amina El Idrissi, mon IBAN est MA64 0111 1000 0012 3456 7890 1234"
│ pseudonymise_text (vault of this conversation)
▼
"Je suis <PERSON_1>, mon IBAN est <MA_IBAN_1>" ──► LLM ──► "Bonjour <PERSON_1>, ..."
│ vault.restore
▼
"Bonjour Amina El Idrissi, ..."
Detection modes
| Mode | What runs | When to use |
|---|---|---|
presidio (default) |
Presidio: Moroccan IBAN (mod-97), CIN, +212 phones, emails, cards (Luhn), spaCy names | tests, machines without a GPU, latency-critical paths |
tracer |
Presidio + PII-Tracer, combined with trimming, typing, cross-confirmation and filters | production: much better on names, addresses and account numbers |
tracer-alone |
PII-Tracer's raw output, every label (dates, URLs, secrets too), no Presidio, no filters | diagnosis: see what the model finds; not for production |
Install
pip install ezpiizi # presidio mode
pip install "ezpiizi[tracer,langchain]" # + PII-Tracer and the LangChain middleware
python -m spacy download fr_core_news_md # French spaCy model (required, not on PyPI)
| Extra | Adds |
|---|---|
tracer |
torch + transformers: PII-Tracer (~1.2 GB, downloaded from Hugging Face on first use, pinned revision) |
langchain |
the LangChain middleware |
bench |
the benchmark datasets loaders |
For development: pip install -e ".[tracer,langchain,bench,dev]".
Quick start
from ezpiizi import PiiVault, configure, enable_tracer, pseudonymise_text
configure(allow=["MyBank"], id_patterns=[r"CLM-\d{4}-\d{4}"]) # optional: your names and ids, never masked
enable_tracer() # optional: tracer mode (loads the model now)
vault = PiiVault() # one per conversation
safe = pseudonymise_text("Je suis Amina El Idrissi, tél 0612345678", vault)
# "Je suis <PERSON_1>, tél <MA_PHONE_1>"
vault.restore("Bonjour <PERSON_1>") # "Bonjour Amina El Idrissi"
In a LangChain agent:
from ezpiizi.middleware import PseudonymisationMiddleware
agent = create_agent(model, tools, middleware=[PseudonymisationMiddleware()], context_schema=Context)
# Context needs a `conversation_id`: it selects the vault.
# Detector: PII-Tracer only by default; mode="tracer" for Presidio + PII-Tracer, mode="presidio" without model.
Try it interactively:
ezpiizi --tracer # or --tracer-alone to see PII-Tracer's raw output
Documentation
| Page | Read it to |
|---|---|
| Concepts | understand placeholders, the vault, restoring, JSON tool results and context |
| Detection | know what is detected, how the two modes work, and how to tune them |
| LangChain integration | wire the middleware into an agent, and protect LLM calls made outside it |
| CLI | test sentences interactively and see why each value is kept or dropped |
| Benchmark | measure detection on MAPA, Gretel or your own sentences |
| Limitations | know the false positives, what is not protected, and the performance envelope |
Layout
src/ezpiizi/
config.py entities, thresholds, allow lists, model ids
recognizers.py Moroccan IBAN / CIN / phone recognizers for Presidio
detection.py presidio mode, mode switch (enable_tracer), detect()
tracer.py PII-Tracer loading (pinned revision) and inference
hybrid.py tracer mode: Presidio + PII-Tracer combination
pseudonymise.py text / JSON pseudonymisation with a vault
vault.py placeholder <-> value store, restore
middleware.py LangChain middleware, PII thread
cli.py interactive tester (ezpiizi)
bench/ benchmark (ezpiizi-bench)
tests/ pytest (pseudonymisation, hybrid rules, middleware, bench scoring)
Run the tests with pytest and the linter with ruff check src tests.
Release
Bump version in pyproject.toml, update CHANGELOG.md, then push a matching tag (git tag v0.1.0 && git push --tags): the Publish to PyPI workflow tests, builds and publishes with trusted publishing.
License
MIT. PII-Tracer is published by Perplexity under the MIT license and downloaded from Hugging Face at a pinned revision; it is not bundled with this package.
Metadata
Release files for ezpiizi 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 | |
|---|---|---|---|---|
| ezpiizi-0.1.0.tar.gz | 38.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ezpiizi-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 65.9 kB
Release files / ezpiizi-0.1.0.tar.gz
| Download URL | ezpiizi-0.1.0.tar.gz |
|---|---|
| Size | 38.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8707ab15054b237cd82952dc427a25f9b18f5946a651a33b2df0112ccf42983e
|
|
BLAKE2b-256 checksum How to use checksums |
1301308c545b3e21abc07581c67d6bfae57ebc3502c86ed43998772d0628bd0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / ezpiizi-0.1.0-py3-none-any.whl
| Download URL | ezpiizi-0.1.0-py3-none-any.whl |
|---|---|
| Size | 27.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70b1806fe71523415da3b2a085b1801e814074aca1d543970b569a5374835c02
|
|
BLAKE2b-256 checksum How to use checksums |
bef766d52d253daba58b45f5842f9aa4b085c8bebe7996de72da86669e770405
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logSecurity for ezpiizi 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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for ezpiizi-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logA 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.