Skip to main content

CourtIQ Python SDK

SDK Python oficial para a API do CourtIQ — consulta processual automatizada.

Instalação

pip install courtiq

Quick Start

from courtiq import CourtIQ

client = CourtIQ(api_key="sua-api-key")

# Buscar processo por número
processo = client.processos.buscar(numero="0001234-56.2024.8.26.0100")
print(processo.partes)

# Consultar múltiplos processos
resultados = client.processos.buscar_lote(
    numeros=["0001234-56.2024.8.26.0100", "0005678-90.2024.8.26.0100"]
)

# Monitorar processo (receber webhooks quando houver movimentação)
monitor = client.monitoramentos.criar(
    numero_processo="0001234-56.2024.8.26.0100",
    webhook_url="https://meu-servidor.com/webhook",
)

Configuração

from courtiq import CourtIQ

# Configuração completa
client = CourtIQ(
    api_key="sua-api-key",
    environment="production",  # "production" ou "sandbox"
    timeout=30,                # timeout em segundos
    max_retries=3,             # retentativas automáticas
    base_url=None,             # URL customizada (self-hosted)
)

Recursos

Processos

# Buscar por número
processo = client.processos.buscar(numero="0001234-56.2024.8.26.0100")

# Buscar com filtros
processos = client.processos.listar(
    tribunal="TJSP",
    parte="João Silva",
    data_inicio="2024-01-01",
    data_fim="2024-12-31",
    pagina=1,
    limite=20,
)

# Movimentações
movs = client.processos.movimentacoes(numero="0001234-56.2024.8.26.0100")

Monitoramentos

# Criar monitoramento
monitor = client.monitoramentos.criar(
    numero_processo="0001234-56.2024.8.26.0100",
    webhook_url="https://meu-servidor.com/webhook",
    eventos=["movimentacao", "publicacao"],
)

# Listar monitoramentos
monitores = client.monitoramentos.listar()

# Remover monitoramento
client.monitoramentos.remover(monitor_id=123)

Webhooks

# Validar assinatura de webhook
from courtiq.webhooks import verificar_assinatura

is_valid = verificar_assinatura(
    payload=request.body,
    signature=request.headers["X-CourtIQ-Signature"],
    secret="seu-webhook-secret",
)

Tratamento de Erros

from courtiq.exceptions import (
    CourtIQError,
    AuthenticationError,
    RateLimitError,
    NotFoundError,
    ValidationError,
)

try:
    processo = client.processos.buscar(numero="...")
except AuthenticationError:
    print("API key inválida ou expirada")
except RateLimitError as e:
    print(f"Rate limit excedido. Tente novamente em {e.retry_after}s")
except NotFoundError:
    print("Processo não encontrado")
except CourtIQError as e:
    print(f"Erro: {e.message} (código: {e.code})")

Ambientes

Ambiente Base URL Descrição
production https://api.courtiq.com.br/v1 Dados reais
sandbox https://sandbox.courtiq.com.br/v1 Dados mock para teste

Licença

MIT

Metadata

Release files for courtiq 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for courtiq 0.1.0
File Size Uploaded Provenance Actions
courtiq-0.1.0.tar.gz 6.9 kB Without provenance Details for courtiq-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for courtiq 0.1.0
File Interpreter ABI Platform Actions
courtiq-0.1.0-py3-none-any.whl Python 3 none any Details for courtiq-0.1.0-py3-none-any.whl

Total release size: 16.4 kB

Release files / courtiq-0.1.0.tar.gz

Download URL courtiq-0.1.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3eeb2bf7c1bef358361816446b19fa1ce47244d86afe6d570532e787f1f9326f
BLAKE2b-256 checksum
How to use checksums
9eb94926dbfb03f22901959956e02bb9f7e36d1a87bc08a2bdf5aa2f836bd39e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / courtiq-0.1.0-py3-none-any.whl

Download URL courtiq-0.1.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d91411ecd7370d82fa9034430079a024b206e756be4e4a6f74b50b764d3ac5e
BLAKE2b-256 checksum
How to use checksums
8a8c48f71dde7bb4ccbf4aa1eef45446a6a40c33d182d41585f79c11b10b46da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for courtiq 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page