pyJudilibre is a small Python wrapper to query the JUDILIBRE API from the French Supreme Court, la Cour de cassation. JUDILIBRE aims to give access to judiciary decisions.
The documentation is here.
This library relies on pydantic and httpx to perform queries to JUDILIBRE and to validate inputs and outputs.
You also need credentials from PISTE.
You can install it from pyjudilibre.
pip install pyjudilibreTo instantiate the main class, JudilibreClient, you need to use your JUDILIBRE API key (see here).
import logging
from pyjudilibre import JudilibreClient
JUDILIBRE_API_KEY = "***"
client = JudilibreClient(
judilibre_api_key=JUDILIBRE_API_KEY,
logging_level=logging.DEBUG,
)To get a decision, you need to provide its ID:
DECISION_ID = "667e51a56430c94f3afa7d0e"
decision = client.decision(decision_id=DECISION_ID)The code of the library is in lib/pyjudilibre:
- the main class and its method are in
pyjudilibre.py - the enums are in
enums.py - the pydantic models are in
models.py - spectific exceptions are defined in
exceptions.py decorators.pycontains one decorator
Other folders are as follow:
- tests contains unit tests.
- docs contains documentation files.
- scripts contains useful scripts to develop the library
To set up a development environment, you should create a virtual environment named venv:
python3 -m venv venv
source venv/bin/activate
pip install '.[dev,build,doc,test]'In scripts, you can use:
- refresh-lib.sh: To reinstall the latest local version of the library
- check-files.sh: To run
isort,ruffandmypyon the files - run-doc-server.sh: To serve the doc on a live local server
- run-lib-tests.sh: To run every unit test
- bump-version.sh: To bump versions in
pyproject.toml, in the library files and in the documentation files. - build-and-test.sh: To build the library, push it to Test-PyPI, pull it in a test environment and run tests.
- build-and-push.sh: To build the library, push it to PyPI.