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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e623e4011faace71d01d5d543cdea78b5914718bfa9cf535ffca642bde5361f2
|
|
| MD5 |
f198d8a4330e91d86f62af2027fcbcb9
|
|
| BLAKE2b-256 |
1b3df7656f75274ba1731984434e1f20761b881b6367c84dae38bad14ce1c4c7
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13de9e94f7d82a2cf2ed3748b6e74cd1b6b85f441a193e59a75e56dca44e823e
|
|
| MD5 |
b7e12865ba1ea901202f9703aa7ac8ff
|
|
| BLAKE2b-256 |
c813534c118eef5c5669a48f4b576fed75def0423a94e3f31cacbdb437039673
|