Skip to main content

Python client for the JUDILIBRE public API

Project description

pyJudilibre

pyJudilibre est une librairie Python qui permet de simplifier l'utilisation de l'API Judilibre avec Python. Le client reprend les différents endpoints de l'API tout en simplifiant certains aspects de cette utilisation, notamment la pagination des résultats.

Initialiser le client

Pour créer le client, il faut possèder une clef d'API et renseigner l'URL de l'API:

from pyjudilibre import JudilibreCient

JUDILIBRE_JUDILIBRE_API_URL = "https://api.piste.gouv.fr/cassation/judilibre/v1.0"
JUDILIBRE_API_KEY = "**************************************************"

client = JudilibreClient(
    judilibre_api_key=JUDILIBRE_API_KEY,
    api_url=JUDILIBRE_JUDILIBRE_API_URL,
)

Méthodes

Healthcheck

Ce client permet de vérifier si l'API est atteignable en interrogeant le endpoint GET /healthcheck.

response = client.healthcheck()
print(response)

Cette méthode renvoie un booléen qui vaut True si l'API est atteignable et False sinon.

Decision

Nous pouvons aussi récupérer une décision en utilisant le endpoint GET /decision et en fournissant un id.

decision = client.get(decision_id="5fca56cd0a790c1ec36ddc07")
print(decision)

Les décisions renvoyées sont normalisées selon un modèle contrôlé par pydantic: JudilibreDecision.

Search

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

pyjudilibre-0.5.3.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

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

pyjudilibre-0.5.3-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file pyjudilibre-0.5.3.tar.gz.

File metadata

  • Download URL: pyjudilibre-0.5.3.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for pyjudilibre-0.5.3.tar.gz
Algorithm Hash digest
SHA256 e623e4011faace71d01d5d543cdea78b5914718bfa9cf535ffca642bde5361f2
MD5 f198d8a4330e91d86f62af2027fcbcb9
BLAKE2b-256 1b3df7656f75274ba1731984434e1f20761b881b6367c84dae38bad14ce1c4c7

See more details on using hashes here.

File details

Details for the file pyjudilibre-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: pyjudilibre-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for pyjudilibre-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 13de9e94f7d82a2cf2ed3748b6e74cd1b6b85f441a193e59a75e56dca44e823e
MD5 b7e12865ba1ea901202f9703aa7ac8ff
BLAKE2b-256 c813534c118eef5c5669a48f4b576fed75def0423a94e3f31cacbdb437039673

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