Metadata-Version: 2.4
Name: pyjudilibre
Version: 0.5.2
Summary: Python client for the JUDILIBRE public API
Project-URL: Homepage, https://github.com/yourname/pyjudilibre
Project-URL: Issues, https://github.com/yourname/pyjudilibre/issues
Author-email: Paul <you@example.com>
License: MIT License
        
        Copyright (c) 2025 Paul Déchorgnat
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.9
Requires-Dist: aenum>=3.1.15
Requires-Dist: httpx==0.28.1
Requires-Dist: pydantic>=2.10.2
Requires-Dist: requests==2.31.0
Requires-Dist: tqdm==4.65.0
Provides-Extra: build
Requires-Dist: build; extra == 'build'
Requires-Dist: twine<=6.0.1; extra == 'build'
Provides-Extra: dev
Requires-Dist: isort==6.0.1; extra == 'dev'
Requires-Dist: jupyterlab==4.0.1; extra == 'dev'
Requires-Dist: pytest==8.4.1; extra == 'dev'
Requires-Dist: python-dotenv==1.1.1; extra == 'dev'
Requires-Dist: ruff==0.12.8; extra == 'dev'
Requires-Dist: twine<=6.0.1; extra == 'dev'
Description-Content-Type: text/markdown

# 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:

```python
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`.

```python
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`.

```python
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`](/pyjudilibre/models/models.py#153).

### Search

