Reference
CLI Reference
Command-line reference for fastpii detect, validate, and list-detectors.
FastPII ships with a CLI named fastpii.
Commands
fastpii detect
Detect PII in inline text or a file.
fastpii detect "Jan Novák, RČ: 8001011238"Arguments and options
| Name | Type | Description |
|---|---|---|
text | positional | Text to analyze |
--file, -f | path | Read text from a file |
--regions, -r | one or more strings | Regions to enable |
--format, -fmt | json or text | Output format |
--output, -o | path | Write output to a file |
Examples
fastpii detect "Jan Novák, email: jan.novak@email.cz"
fastpii detect --file contract.txt
fastpii detect "IČO: 25596641" --regions cz --format json
fastpii detect "RČ: 8001011238" --output result.txtExample text output
Detected 1 finding(s) in 0ms:
[1] rodne_cislo: 8001011238
Position: 4-14
Region: cz
Confidence: 95.0%
Metadata:
- checksum_valid: True
- birth_date: 1980-01-01
- gender: male
- article_9: TrueExample JSON output
{
"text": "IČO: 25596641",
"findings": [
{
"type": "ico",
"value": "25596641",
"start": 5,
"end": 13,
"confidence": 1.0,
"region": "cz",
"metadata": {
"checksum_valid": true
}
}
],
"detector_names": ["ico"],
"processing_time_ms": 0
}fastpii validate
Validate one value with a specific detector.
fastpii validate 8001011238 --detector rodne_cisloArguments and options
| Name | Type | Description |
|---|---|---|
value | positional | Value to validate |
--detector, -d | string | Detector to use |
--regions, -r | one or more strings | Regions to enable |
--format, -fmt | json or text | Output format |
Examples
fastpii validate 8001011238 --detector rodne_cislo
fastpii validate 25596641 --detector ico --format json
fastpii validate CZ25596641 --detector dicExample text output
Validation Result:
Detector: rodne_cislo
Value: 8001011238
Status: ✓ VALID
Metadata:
- checksum_valid: True
- birth_date: 1980-01-01
- gender: male
- article_9: TrueExample JSON output
{
"detector": "ico",
"value": "25596641",
"is_valid": true,
"metadata": {
"checksum_valid": true
}
}fastpii list-detectors
List the available detectors for the selected regions.
fastpii list-detectorsOptions
| Name | Type | Description |
|---|---|---|
--regions, -r | one or more strings | Regions to enable |
--format, -fmt | json or text | Output format |
Examples
fastpii list-detectors
fastpii list-detectors --regions cz --format jsonExample text output
Available Detectors:
------------------------------------------------------------
rodne_cislo (cz)
Czech birth number (rodné číslo) detector with checksum validation
ico (cz)
Czech company ID (IČO) detector with checksum validation
dic (cz)
Czech VAT number (DIČ) detector
------------------------------------------------------------
Total: 11 detectorsExample JSON output
[
{
"name": "rodne_cislo",
"region": "cz",
"description": "Czech birth number (rodné číslo) detector with checksum validation"
},
{
"name": "ico",
"region": "cz",
"description": "Czech company ID (IČO) detector with checksum validation"
}
]