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.4.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.4-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyjudilibre-0.5.4.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.4.tar.gz
Algorithm Hash digest
SHA256 cdacf94c65ab9595790a7c52bcace8cafa81fc95b4b2e14b169255d8def1d1cb
MD5 828a74740c8c23c1e1628465b2441bec
BLAKE2b-256 35580cb73018c33f8af2461fd30a55dda44a7ddc7050b94bcaafe06dcfab8a15

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyjudilibre-0.5.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 68fa96a8de83f889a89eb1d03c3a41c5080bf5a1c57237ab86d4550d799ed2a2
MD5 c50c4e8e3c1299af50ac35fc64eb77da
BLAKE2b-256 2745883f7e2fd3ab8c5b37fabe6b31c464c04d6955f38b97d06b3efd0c7f1385

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