Metadata-Version: 2.4
Name: verifiquemos
Version: 0.2.2
Summary: Official Python SDK for the Verifiquemos compliance API
Project-URL: Homepage, https://verifiquemos.com/developers
Project-URL: Documentation, https://api.verifiquemos.com/scalar
Author-email: Verifiquemos <soporte@verifiquemos.com>
License-Expression: MIT
License-File: LICENSE
Keywords: api,compliance,guatemala,kyc,ofac,renap,sdk,verifiquemos
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic[email]>=2.7
Requires-Dist: python-ulid>=3.0
Provides-Extra: dev
Requires-Dist: datamodel-code-generator>=0.26; extra == 'dev'
Requires-Dist: hatch>=1.13; extra == 'dev'
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.7; extra == 'dev'
Description-Content-Type: text/markdown

# verifiquemos

Official Python SDK for the [Verifiquemos](https://verifiquemos.com) compliance API.

> KYC, RENAP, OFAC, ONU, Lista Engel, PEP, CPE — Guatemala-specific compliance in one API call.

## Requirements

- Python >= 3.10 (tested on 3.10, 3.11, 3.12, 3.13, 3.14)

## Install

```bash
pip install verifiquemos
```

## Quickstart (sync)

```python
from verifiquemos import VerifiquemosClient

with VerifiquemosClient(api_key="vfq_...") as client:
    me = client.auth.me()
    print(me["tenant"]["name"])

    # cui is NOT a parameter — it is extracted from the DPI via OCR.
    with open("dpi.jpg", "rb") as f:
        validation = client.validations.create(
            naturaleza_cliente="individual",
            dpi_file=f.read(),
            pais_origen_fondos="GTM",
        )
    print(f"Validation submitted: {validation['id']}")
```

## Quickstart (async)

```python
import asyncio
from verifiquemos import AsyncVerifiquemosClient

async def main():
    async with AsyncVerifiquemosClient(api_key="vfq_...") as client:
        me = await client.auth.me()
        print(me)

asyncio.run(main())
```

## Poll and download the report

`create()` returns immediately; the validation runs asynchronously. Poll `get()` until it
finishes, then fetch the PDF report.

```python
import time

while True:
    result = client.validations.get(validation["id"])
    if result["status"] == "completed":
        break
    time.sleep(3)

pdf_bytes = client.validations.report(validation["id"])   # raw PDF bytes
with open("report.pdf", "wb") as f:
    f.write(pdf_bytes)
```

## Error handling

```python
from verifiquemos import ApiError, RateLimitError, NetworkError, VerifiquemosClient

with VerifiquemosClient(api_key="vfq_...") as client:
    try:
        client.validations.create(...)
    except RateLimitError as e:
        print(f"Retry after {e.retry_after_seconds}s")
    except ApiError as e:
        if e.is_payment_required:
            print("Buy more credits")
        else:
            raise
    except NetworkError:
        print("Connection failed")
```

## Configuration

| Argument | Default | Description |
|---|---|---|
| `api_key` | (required) | Server-issued API key. Starts with `vfq_`. |
| `base_url` | `https://api.verifiquemos.com` | Override for staging/dev. |
| `timeout` | 30.0 | httpx timeout in seconds. |

## Documentation

- API reference: <https://api.verifiquemos.com/scalar>
- Developer portal: <https://verifiquemos.com/developers>
- Release notes: [`CHANGELOG.md`](./CHANGELOG.md)

## Development

```bash
cd verifiquemos-sdk-python
pip install -e ".[dev]"
pytest tests/ -v                              # tests (respx mockea httpx)
ruff check verifiquemos/ tests/
mypy verifiquemos/ --ignore-missing-imports

# Los modelos en verifiquemos/_generated/ se generan desde el OpenAPI del API.
# No editarlos a mano; regenerar tras cambios de contrato (requiere el repo
# hermano ../verifiquemos-api):
bash scripts/regen_models.sh             # lee ../verifiquemos-api/openapi.json
```

Publicacion a PyPI: el push de un tag git `v<version>` dispara el pipeline (`hatch build` + `twine upload`). Ver [`CHANGELOG.md`](./CHANGELOG.md).

## License

MIT
