Python client for the JUDILIBRE public API
Project description
pyJudilibre
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.
Documentation
The documentation is here.
Requirements
This library relies on pydantic and httpx to perform queries to JUDILIBRE and to validate inputs and outputs.
You also need credentials from PISTE.
Installation
You can install it from pyjudilibre.
pip install pyjudilibre
Simple usage
To 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)
Description of the source code
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
Development setup
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.
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.14.2.tar.gz.
File metadata
- Download URL: pyjudilibre-0.14.2.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08b323daea61d619ddcebd4b51a4a2a532ff5bdf4eb9a7b18a756bbde71963a0
|
|
| MD5 |
92b38ee8d29d1775d4646a5a116ae5c5
|
|
| BLAKE2b-256 |
46e5bfa34b3c67e9bca2e97c7998d7c205030379a6102e6b103c2c56d6bb89c0
|
File details
Details for the file pyjudilibre-0.14.2-py3-none-any.whl.
File metadata
- Download URL: pyjudilibre-0.14.2-py3-none-any.whl
- Upload date:
- Size: 22.1 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 |
4a56883d7833944e68f2f5316b776a4be77ef5ec95ffe0e70cf53d65beee378c
|
|
| MD5 |
500c3247d6cd7f4120d55c6c3a8deac3
|
|
| BLAKE2b-256 |
78679032d48d369e3c304e3a4c2388eec658b10b46a8bc605f3967d95b398013
|