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.8.3.tar.gz (17.7 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.8.3-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyjudilibre-0.8.3.tar.gz
Algorithm Hash digest
SHA256 9e12c23251d198cc0e6a5fc67de09a3661fda3e672dcb7afafffe82c9445cf72
MD5 68fda712355fe95d8e681ffcf4fcab03
BLAKE2b-256 83f57b888ac60ba91849c5d5f188e2b96e62c5b4712518d14d1b6a1b05b1ee4e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyjudilibre-0.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e376f744285ed366e53133fd3405d7b318f8bc0e8be4b4db381e79eb2687c359
MD5 d001c04d8b76cdb57bb880770b3da1e5
BLAKE2b-256 dffd8f9c4192b361b0264c245a92f158f03d89c5c318168c9473d614ae21c26b

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