Skip to main content

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.

Logo de pyjudilibre ?

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.py contains 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:

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.13.0.tar.gz (18.8 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.13.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyjudilibre-0.13.0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for pyjudilibre-0.13.0.tar.gz
Algorithm Hash digest
SHA256 579c7e07a4d65381f0f90b9774690ee57e28e8bf30e3b14ec4db5b7d6514739b
MD5 703cfc41420e67f29656982b01cffcaa
BLAKE2b-256 7c035048cb7760d585293af60a69ec3dc4c844d5c9b4910e1226c5b4485f50b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyjudilibre-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for pyjudilibre-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d3ddaa3f7440c48da6d212c13c01d9904f04be8f75caf32d189ebe0c78cbb88
MD5 47c17b46da6b093583a1b9611a1a9dbd
BLAKE2b-256 dba8d079f11f97f01cb940ce0f474a9462a273324578bd422c2c584a8c6ca758

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