Integrations
CLI
Use the FastPII command-line interface to detect PII, validate identifiers, and list available detectors.
CLI reference
FastPII ships with a fastpii command that supports detection, validation, and detector listing from the terminal.
Installation
pip install fastpiiSetup
After installation, the CLI entry point is available as:
fastpiiUsage examples
Detect PII in inline text
fastpii detect "Jan Novak, rodne cislo 8001011234"Detect PII from a file
fastpii detect --file ./document.txtDetect PII and write JSON output to a file
fastpii detect "Jan Novak, rodne cislo 8001011234" --format json --output ./result.jsonValidate an identifier
fastpii validate 8001011234 --detector rodne_cisloList available detectors
fastpii list-detectorsCommands reference
fastpii detect <text>
You can pass text directly:
fastpii detect "some text"Or read from a file:
fastpii detect --file ./document.txtOptions:
--file,-f: read text from a file path--regions,-r: list of regions, defaultcz--format,-fmt:jsonortext, defaulttext--output,-o: write output to a file
If neither text nor --file is provided, the command exits with an error.
fastpii validate <value> --detector <name>
fastpii validate 8001011234 --detector rodne_cisloOptions:
--detector,-d: required detector name--regions,-r: list of regions, defaultcz--format,-fmt:jsonortext, defaulttext
If the detector is unknown, the CLI prints an error and shows available detectors.
fastpii list-detectors
fastpii list-detectorsOptions:
--regions,-r: list of regions, defaultcz--format,-fmt:jsonortext, defaulttext
Output reference
Detect output fields
JSON output from detect contains:
{
"text": "string",
"findings": [
{
"type": "string",
"value": "string",
"start": 0,
"end": 0,
"confidence": 0.0,
"region": "string",
"metadata": {}
}
],
"detector_names": ["string"],
"processing_time_ms": 0
}Validate output fields
JSON output from validate contains:
{
"detector": "string",
"value": "string",
"is_valid": true,
"metadata": {}
}