Skip to main content

Zypp CLI

Internal CLI for Zypp: load secrets from Azure Key Vault and anonymize client files locally with Microsoft Presidio.

Installation

uv tool install zyppcli

To upgrade to the latest version:

uv tool install zyppcli --upgrade

Key Vault prerequisites

You need to be authenticated with Azure:

az login

Usage

Anonymize PDF, Excel or text files

Install Zypp CLI normally, then download both local spaCy models once:

uv tool install zyppcli
zypp anonymize --setup

To install from this checkout, use uv tool install . instead. To upgrade an existing installation, use uv tool install zyppcli --upgrade. Setup installs the Dutch and English models into the CLI's own environment, using uv when available or pip otherwise. It can be run again safely. Downloading models requires network access; anonymizing client files does not download anything.

Scanned PDFs and PDF pages with images or annotations also need local Tesseract OCR and its Dutch (nld) and English (eng) language packs:

# macOS
brew install tesseract tesseract-lang

# Ubuntu/Debian
sudo apt-get install tesseract-ocr tesseract-ocr-nld tesseract-ocr-eng

# Check which language packs are available
tesseract --list-langs
zypp anonymize report.pdf
# -> report.anonymized.pdf

zypp anonymize customers.xlsx
# -> customers.anonymized.xlsx

zypp anonymize ./client-files
# -> ./client-files.anonymized/ (recursive, with relative file paths preserved)

zypp anonymize report.pdf --language en
zypp anonymize ./client-files --output ./review-copy

Dutch is the default. Processing uses local Presidio/spaCy/Tesseract engines; client files are not sent to cloud services. By default, detected values are replaced with synthetic data: fake names, example-domain emails, generated bank accounts and other values of the detected type. The same entity type and exact value receive the same replacement within one run; the in-memory mapping is not saved. Different runs generate new data.

# Default: fill detected fields with bogus data
zypp anonymize report.pdf

# Previous behavior: black PDF boxes and entity-label replacements in text/Excel
zypp anonymize report.pdf --redact

PDF originals are removed before replacement text is drawn, including text in images. Unaffected native text stays selectable. Native replacements preserve the original font size and baseline, using a built-in font with matching family/weight/style. Scanned replacements estimate the size from OCR glyph bounds. Long fake values are abbreviated with ... to fit the original field; they are never shrunk. No original text is left hidden under the replacement. If a field cannot fit even one replacement character at the original size, that field gets a black redaction and processing continues. The CLI reports the number of such fields. A synthetic PDF field is not an editable form widget.

Detection is broad by default: organization names and locations are included, as well as personal identifiers. Dates are now excluded by default, including birth dates; ordinary dates and durations are usually useful business content. To include dates, explicitly select DATE_TIME alongside the other entity types you need. Recognized durations such as 8 maanden or 8 months stay unchanged even with DATE_TIME selected. For business documents where you want to keep those categories, opt into the narrower personal profile:

zypp anonymize report.pdf --profile personal

This profile targets people, email addresses, phone numbers, Dutch BSNs, IBANs and credit cards. It leaves organization names, locations and dates alone, including birth dates. It reduces false positives on ordinary Dutch business terms that the language model mistakes for organizations or places. It does not prevent all incorrect detections of person names.

For more specific tuning:

# Choose exactly which Presidio entity types to detect (overrides the profile)
zypp anonymize report.pdf --entities PERSON EMAIL_ADDRESS PHONE_NUMBER NL_BSN IBAN_CODE

# Explicitly include calendar dates (entity selection overrides the profile)
zypp anonymize report.pdf --entities PERSON EMAIL_ADDRESS PHONE_NUMBER NL_BSN IBAN_CODE DATE_TIME

# Discard detections below a Presidio score of 0.7
zypp anonymize report.pdf --profile personal --score-threshold 0.7

# Keep an exact detected phrase; repeat the option for more phrases
zypp anonymize report.pdf --allow-list Vakantiebijslag --allow-list Onregelmatigheids-

Settings apply to native PDF text, OCR, Excel, CSV and text/JSON alike. Allow-list matches are exact and case-sensitive. The default score threshold remains 0, keeping broad detection within the selected categories. Raising it is not a universal fix: spaCy name/location/organization detections commonly share the same fixed score, so a high threshold can discard real names as well as false positives. Start by choosing the categories your use case needs; use an allow-list for known-safe exact phrases.

Format Result
.pdf Preserves unaffected selectable text on native and mixed pages. Scans use OCR for detection and remain image content. Detected characters are deleted and matching image pixels are blanked before synthetic text is inserted; --redact uses black fills. Interactive forms, annotations, links and original document metadata are removed.
.xlsx Fresh values-only workbook. All worksheets and hidden cells are processed; output tabs are named Sheet1, Sheet2, etc. Formulas, formatting, comments, links, drawings and original metadata are omitted.
.csv, .tsv Properly quoted UTF-8 data with cell-level replacements. CSV uses commas; TSV uses tabs.
.txt, .md, .log UTF-8 text with synthetic values, or entity labels with --redact.
.json, .jsonl Valid JSON with processed keys and values. Colliding or duplicate keys are rejected.

Excel formulas use the results saved by Excel. If a formula has no saved result, the workbook fails with an instruction to recalculate and save it in Excel. Numeric identifiers are scanned too; matched numbers become replacement strings. Unmatched values retain their types, and text leading zeroes are preserved. Custom Excel display formats such as 000000000 are not retained. Excel drawings and embedded objects are omitted with a warning, rather than processed as images.

Originals are preserved. Rerunning replaces matching output files automatically; you do not need to delete earlier output first. Replacement is atomic: a failed rerun keeps the previous completed output. Folder reruns keep unrelated existing files. Source/output overlap and symbolic links are refused.

For folders, unsupported files are skipped. Failed new files have no final output, and completed files are retained. A skipped or failed file makes the command exit with status 1 and report a partial run. Temporary files and new output use owner-only permissions where supported.

Dutch invoice coverage includes an IBAN-field fallback for OCR spacing/character confusion and a targeted name recognizer for initials and a surname after T.a.v. or Ter attentie van, plus Dutch VAT ID format detection (NL_VAT) in broad mode. The personal profile includes the name recognizer but omits VAT IDs unless explicitly selected through --entities. These focused rules help with invoice fields; arbitrary names and addresses can still be missed.

Review output before sharing. Detection and OCR can miss personal data or replace harmless text. Faces, signatures, indirect identifiers and every kind of address or sensitive fact are not comprehensively detected. Filesystem names remain unchanged and may themselves identify people. Legacy .xls, macro-enabled Office files and password-protected PDFs are not supported.

For implementation details, see the anonymize plan.

List Key Vaults

zypp keyvault list --subscription <subscription-id>

Lists all accessible Key Vaults in the given Azure subscription.

To filter by name (case-insensitive substring match):

zypp keyvault list --subscription <subscription-id> --name dev

Load secrets from Azure Key Vault

eval $(zypp keyvault load --vault <vault-name>)

This fetches all enabled secrets from the specified vault and exports them as environment variables. Secret names are transformed: hyphens become underscores and the name is uppercased (e.g. db-password becomes DB_PASSWORD).

Without eval, the command only prints the export statements without setting them:

zypp keyvault load --vault <vault-name>
# Output:
# export DB_PASSWORD='...'
# export SQL_DB='...'

Version

zypp --version

Development and checks

uv sync
uv run --no-sync zypp anonymize --setup
uv run --no-sync pytest
uv run --no-sync pytest -m integration
uvx prek run --all-files

The default suite tests file handling and document adapters without spaCy models or Tesseract. Integration tests require both language models, Tesseract and its nld/eng packs; they exercise real detection, scans, mixed PDFs and the CLI. Use --no-sync after setup: an exact uv sync removes model packages that are not in the project lockfile. Run setup again if needed. CI runs both suites.

Metadata

Release files for zyppcli 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zyppcli 0.4.2
File Size Uploaded Provenance Actions
zyppcli-0.4.2.tar.gz 198.8 kB Without provenance Details for zyppcli-0.4.2.tar.gz

Built distribution (wheel)

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

Total release size: 221.6 kB

Release files / zyppcli-0.4.2.tar.gz

Download URL zyppcli-0.4.2.tar.gz
Size 198.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4766170b83657dd54ca6373cc26458be5279100f37c209400c2ffd710e2d5871
BLAKE2b-256 checksum
How to use checksums
1bec12b9eb85dace95246c91fe08aa8ef99edd902c4f86cc69f929d67346503e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / zyppcli-0.4.2-py3-none-any.whl

Download URL zyppcli-0.4.2-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db2cc14a2b370085a1046e2fef2d939d13867500a35619701723b39873916d61
BLAKE2b-256 checksum
How to use checksums
06be22dd859cfd24e0662740c9d157224f6185459fc806147c80a739c876cc03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for zyppcli 0.4.2

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.

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