Metadata-Version: 2.5
Name: clientcaptain
Version: 1.0.0
Summary: Open-source screening for identity primitives.
Author: Francesco Coniglione
License: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: dnspython<3,>=2.6
Requires-Dist: httpx<1,>=0.27
Requires-Dist: rich<15,>=13
Requires-Dist: typer<1,>=0.12
Description-Content-Type: text/markdown

# ClientCaptain

[GitHub repository](https://github.com/ClientCaptain/client-captain-cli) · [Documentation](https://clientcaptain.io/docs)

Open-source CLI and Python SDK for email, domain, and IP screening.

## Install

```bash
pip install clientcaptain
```

## CLI

```bash
clientcaptain check suspicious@tempmail.com
clientcaptain check example.com
clientcaptain check 185.220.101.5
```

Pass `--json` (`-j`) to print the raw JSON API response for shell scripts or CI/CD pipelines:

```bash
clientcaptain check suspicious@tempmail.com --json
```

The CLI resolves `MX`, `SPF`, and `DMARC` records locally via DNS and queries:

```text
POST https://www.api.clientcaptain.io/v1/screen
```

To point the CLI at a local or staging instance, pass `--api-url` or set `CLIENTCAPTAIN_API_URL`:

```bash
clientcaptain check 185.220.101.5 --api-url http://localhost:8000
CLIENTCAPTAIN_API_URL=http://localhost:8000 clientcaptain check 185.220.101.5
```

## Python SDK

```python
from clientcaptain import ClientCaptain

client = ClientCaptain()
result = client.screen(email="user@example.com")
print(result["verdict"])  # ALLOW | FLAG | BLOCK
```

Pass `api_key` (for upcoming Pro keys) or override `base_url`:

```python
client = ClientCaptain(
    base_url="https://www.api.clientcaptain.io",
    api_key="cc_live_...",
)
result = client.screen(ip="185.220.101.5")
```

Async usage:

```python
import asyncio
from clientcaptain import ClientCaptain

async def main() -> None:
    client = ClientCaptain()
    result = await client.screen_async(ip="185.220.101.5")
    print(result)

asyncio.run(main())
```

## Data & Privacy

- **Local DNS checks:** `MX`, `SPF`, and `DMARC` lookups run directly from your machine against your configured DNS resolver.
- **API lookups:** Only the normalized target (`email`, `domain`, or `ip`) is sent over HTTPS to `www.api.clientcaptain.io` to check disposable domain lists and IP/CIDR blocklists.
- **Failure behavior:** If the API is unreachable, rate-limited (`HTTP 429`), or returns an invalid payload, the CLI exits with status code `1` and the SDK raises an exception rather than defaulting to `ALLOW`.

## Disclaimer

ClientCaptain verdicts, DNS results, and threat-intelligence data are provided
on a best-effort basis. They may be incomplete, delayed, unavailable, or
incorrect, and must not be relied upon as the sole basis for security,
compliance, identity, or access-control decisions. No result or absence of a
signal guarantees that a target is safe or malicious.

Use ClientCaptain with appropriate human review and other independent security
controls. The software is provided under the MIT License without guarantees
or warranties as described in the license.

## License

MIT