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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyjudilibre-0.5.2.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.2.tar.gz
Algorithm Hash digest
SHA256 9245edec545fd9644f8513503dbf1aa890449fdf4d9bb9e89f938546e4426b7b
MD5 066c647524edb726533f9a7fbe20e47c
BLAKE2b-256 0f8b2cb1a7542ed314a74ab93ce6fcce94cc0d14ac7fa2527818577a25f7d206

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyjudilibre-0.5.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5b8b9c1056a71a8bcd2203e979d921fdb8bbcbecdd55bb6505e1d50578066ccc
MD5 8bac66b8af729b7a03ed0a91db5ec3b7
BLAKE2b-256 1ab732b5d6f9733dcf1825db1afff7849d0a39b6a71301948e757fc0c0cbe21a

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