Skip to main content

Cliente Python para API pública do DataJud

Project description

pydatajud

Cliente Python para consultar a API pública do DataJud/CNJ por número CNJ e extrair movimentações processuais em formato estruturado.

O projeto não é afiliado ao CNJ. Ele apenas empacota um fluxo comum de consulta à API pública oficial.

Instalação

pip install pydatajud

Para desenvolvimento local:

pip install -e ".[dev]"

Uso rápido

from pydatajud import DataJudClient

client = DataJudClient(api_key="sua-api-key")
result = client.search_by_process_number("0000832-35.2018.4.01.3202")

print(result.endpoint)
print(result.movimentos)

CLI

export DATAJUD_API_KEY="sua-api-key"
pydatajud --processo "0000832-35.2018.4.01.3202"

Também é possível passar a chave diretamente:

pydatajud --api-key "sua-api-key" --processo "0000832-35.2018.4.01.3202"

Para imprimir apenas a lista de movimentações:

pydatajud --processo "0000832-35.2018.4.01.3202" --movimentos-only

O que a biblioteca faz

  • Valida e normaliza números processuais CNJ.
  • Resolve automaticamente o endpoint DataJud a partir dos campos J e TR.
  • Consulta o endpoint público correspondente.
  • Retorna os hits brutos e a lista agregada de movimentos.
  • Expõe erros próprios para autenticação, resposta inválida, processo não encontrado e tribunal sem endpoint mapeado.

Limitações

  • A API pública do DataJud exige chave APIKey.
  • Processos sigilosos ou indisponíveis na base pública podem não retornar dados.
  • A cobertura, disponibilidade e regras de uso são definidas pelo CNJ.
  • O usuário é responsável por cumprir os termos de uso do CNJ e a legislação aplicável, incluindo LGPD.

Desenvolvimento

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
ruff check .
ruff format --check .
mypy src tests
pytest
python -m build
twine check dist/*

Links úteis

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

pydatajud-0.1.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

pydatajud-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file pydatajud-0.1.0.tar.gz.

File metadata

  • Download URL: pydatajud-0.1.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydatajud-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1f6221fc7bad5e861ac3502c1c1af38ec4bc78aab30de8f5c91d715e49a5d575
MD5 781756588bad785016728f0c7954981e
BLAKE2b-256 d979f7dfcf721bb69ca2d494da3328f186a398381bb9a0dc24cad9a9d29df332

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydatajud-0.1.0.tar.gz:

Publisher: publish.yml on Filipe-Araujo0/pydatajud

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pydatajud-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pydatajud-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydatajud-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 456efd63fcb96df5e9efb4a0b1ca6114c6f79c7a22389b3925f551c49b8b4892
MD5 feffb95e5e1de5bfa936cf446f5315d8
BLAKE2b-256 d74c5d2ea4d7fd4c2a6d9c948c0a13d75987ebb90e32061f325edcc06749fdad

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydatajud-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Filipe-Araujo0/pydatajud

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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