Skip to main content

Official Python SDK for the Verifiquemos compliance API

Project description

verifiquemos

Official Python SDK for the Verifiquemos 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

pip install verifiquemos

Quickstart (sync)

from verifiquemos import VerifiquemosClient

with VerifiquemosClient(api_key="vfq_...") as client:
    validation = client.validations.create(
        naturaleza="persona_individual",
        cui="1234567890101",
        nombre_completo="Juan Pérez",
        actividad_economica="asalariados",
        tipo_cliente="individual_nacional_renap",
        producto_servicio="cuenta_ahorros",
        perfil_ingreso="baja",
    )
    print(f"Validation submitted: {validation['id']}")

Quickstart (async)

import asyncio
from verifiquemos import AsyncVerifiquemosClient

async def main():
    async with AsyncVerifiquemosClient(api_key="vfq_...") as client:
        validation = await client.validations.create(
            naturaleza="persona_juridica",
            nit="1234567",
            razon_social="ACME S.A.",
            actividad_economica="comercio_mayorista",
            tipo_cliente="juridica_nacional",
            producto_servicio="cuenta_monetaria",
            perfil_ingreso="alta",
        )
        print(f"Validation submitted: {validation['id']}")

asyncio.run(main())

Poll and download the report

create() returns immediately; the validation runs asynchronously. Poll get() until the status reaches a terminal state, then fetch the report via the signed URL the API returns.

import time
import httpx

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

# A report is only generated for completed runs. Skip the round-trip on
# failed / cancelled so the example doesn't make a noisy request for an
# artifact the API won't return.
if result["status"] in ("completed", "completed_partial"):
    report = client.validations.report(validation["id"])
    # report = {"report_url": "https://...", "expires_at": None}
    # report_url is always present per the schema; expires_at may be None
    # until the SAS-signing layer lands on the server.
    pdf = httpx.get(report["report_url"]).content
    with open("report.pdf", "wb") as f:
        f.write(pdf)

List, cancel and catalogs

# Paginated list (filter by status optional)
page = client.validations.list(status="pending", limit=20, offset=0)
print(page["total"], "validations,", len(page["items"]), "in this page")

# Cancel an in-flight validation (idempotent — second call replays the first)
cancelled = client.validations.cancel(validation["id"])

# Catalogs the SDK exposes for client-side dropdowns
client.catalogs.naturalezas()           # 2 SIB-regulated values
client.catalogs.actividades_economicas()
client.catalogs.tipos_cliente()
client.catalogs.productos_servicios()
client.catalogs.perfiles_ingreso()

# Country lookups (Guatemala-specific compliance: OFAC/GAFI sanctions list)
client.countries.list(search="guate")
client.countries.list_sanctioned()

Error handling

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/external/v1 Override for staging/dev.
timeout 30.0 httpx timeout in seconds.

Documentation

Development

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 externo
# 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-external.json

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

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

verifiquemos-0.6.0.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

verifiquemos-0.6.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file verifiquemos-0.6.0.tar.gz.

File metadata

  • Download URL: verifiquemos-0.6.0.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for verifiquemos-0.6.0.tar.gz
Algorithm Hash digest
SHA256 9143a70c337a32347c592833a3b661f392b5f587ea7e57df160a6e44867e1b77
MD5 77422475822f50e5c894a3431070da90
BLAKE2b-256 ed34407cdecb04ed3a2eb15ae8a379f00601cfde78813e58f276b0e2bec21410

See more details on using hashes here.

File details

Details for the file verifiquemos-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: verifiquemos-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for verifiquemos-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8579847a82a652ea8f0d27fc0b3f56380815a3e57b0c631eca78908ec1a4515
MD5 09d6a10f162f5ef5d559cf7b50a76ce5
BLAKE2b-256 4ad39bf8f49f0e91c10dbfcc8f37de2903c8c4defd367d6d1722de3cc5d685fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page