Metadata-Version: 2.5
Name: fastpii-connect
Version: 0.3.1
Summary: Client SDK for the FastPII AI Data Security Platform — detect and protect sensitive data before it reaches AI systems
License: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: httpx>=0.25.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.9.0
Provides-Extra: dev
Requires-Dist: mypy>=1.8; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=7.4; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.2; extra == 'dev'
Description-Content-Type: text/markdown

# FastPII Connect

Client SDK for the FastPII AI Data Security Platform.

FastPII detects and protects sensitive information before it reaches AI systems, enabling organisations to use AI securely while meeting privacy and governance requirements.

## Installation

```bash
pip install fastpii-connect
```

## Quick Start

```python
from fastpii_connect import FastPIIClient

client = FastPIIClient(api_key="fpk_your_api_key")

# Detect PII
result = client.detect("My rodné číslo is 900101/1234")
for entity in result.entities:
    print(f"Found {entity.type}: {entity.original}")

# Protect PII
result = client.protect("My rodné číslo is 900101/1234", mode="replace")
print(result.protected_text)

# Validate an identifier
result = client.validate("900101/1234", entity_type="rodne_cislo")
print(f"Valid: {result.valid}")

# List available detectors
detectors = client.list_detectors(country="CZ")
for d in detectors.detectors:
    print(f"{d.name}: {d.description}")
```

## Context Manager

```python
with FastPIIClient(api_key="fpk_your_api_key") as client:
    result = client.detect("Hello world")
```

## Session Management

```python
client = FastPIIClient(api_key="fpk_your_api_key")
session = client.create_session()

result1 = session.detect("My rodné číslo is 900101/1234")
print(session.countries)  # ["CZ"]

result2 = session.detect("My PESEL is 90010112345")
print(session.countries)  # ["CZ", "PL"]
```

## Error Handling

```python
from fastpii_connect.errors import (
    AuthenticationError,
    RateLimitError,
    QuotaExceededError,
    ValidationError,
)

try:
    result = client.detect("text")
except AuthenticationError:
    print("Invalid API key")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after} seconds")
except QuotaExceededError:
    print("Monthly quota exceeded")
```

## License

MIT — see LICENSE file.