Aller au contenu

omnilex/judilibre Référence de l’API

Étage
Fournisseur · Omnilex
Version
1.x
Suite de conformité
non branchée
Vérifié en réel
Non vérifié en réel
Licence
MIT
composer require omnilex/judilibre:1.x-dev

Lue dans les fichiers PHP du paquet au commit e0de7a748df3 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnilex\Judilibre

  • JudilibreSource class

    Judilibre, the Cour de cassation's open data of the judicial courts' decisions, through PISTE (the API's OpenAPI description, version 1.2.5):

    9 methods · 4 constants

  • JudilibreSourceFactory class

    Judilibre, through PISTE. The application signs with its PISTE OAuth credentials, or with its PISTE API key (the KeyId header):

    4 options

Omnilex\Judilibre

JudilibreSource class

final class JudilibreSource extends HttpSource implements SearchInterface, DecisionReaderInterface, CitationsInterface, RecentInterface JudilibreSource.php:44

Judilibre, the Cour de cassation's open data of the judicial courts' decisions, through PISTE (the API's OpenAPI description, version 1.2.5):

GET /search full-text search with filters, 50 a page, 10 000 at most GET /decision one decision, whole GET /export batches of decisions by date, for what is new GET /taxonomy the keys the filters take, with their labels GET /transactionalhistory what was created, updated or deleted since a date

The decisions are pseudonymised by the Cour de cassation before they are published. They are given as they are: nothing here tries to put a name back on a person, by cross-reference or otherwise, and an application that shows them must not either (the re-use conditions forbid it). When Judilibre withdraws a decision - changes() says so - the application must drop its copy.

const BASE_URI = 'https://api.piste.gouv.fr/cassation/judilibre/v1.0'
const SANDBOX_URI = 'https://sandbox-api.piste.gouv.fr/cassation/judilibre/v1.0'
const MAX = 50

The most results /search gives per page.

const BATCH_MAX = 1000

The most decisions /export gives per batch.

JudilibreSource::__construct()

public function __construct(HttpClientInterface $http, string $baseUri = self::BASE_URI, ?TokenProviderInterface $auth = null, array $headers = [], float $throttle = 0.5, readonly string $recent = 'update', readonly bool $resolve = false)
$recent

the date recent() reads: "update" (created or updated in the base) or "creation"

$resolve

ask for labels in place of keys (resolve_references)

$headers

the KeyId header, when the application signs with its PISTE key

JudilibreSource::getName()

public function getName(): string

JudilibreSource::capabilities()

public function capabilities(): Capabilities
public function search(Query $query): Results

JudilibreSource::recent()

public function recent(\DateTimeInterface $since, ?Query $query = null): Results

JudilibreSource::decision()

public function decision(Identifier|string $id): ?Decision

JudilibreSource::citations()

public function citations(Identifier|string $id, int $limit = 100): array

JudilibreSource::taxonomy()

public function taxonomy(string $id, ?string $context = null): array

The terms of one of Judilibre's lists, key => label: "jurisdiction", "chamber", "formation", "type", "theme", "publication", "solution", "location"... ($context: "cc", "ca", "tj" for the lists that depend on the kind of court). What Query::$jurisdictions, $types and $subjects take, and what labels the keys the decisions carry.

JudilibreSource::changes()

public function changes(\DateTimeInterface $since, ?string $cursor = null, int $limit = 500): array

What happened in the base since that moment, oldest first: each decision created, updated or deleted. A deleted decision must be deleted by whoever kept a copy.

$cursor

the "next" of the page before

JudilibreSourceFactory class

final class JudilibreSourceFactory extends SourceFactory JudilibreSourceFactory.php:26

Judilibre, through PISTE. The application signs with its PISTE OAuth credentials, or with its PISTE API key (the KeyId header):

options: client_id: '...' # with client_secret: OAuth, client credentials client_secret: '...' key_id: '...' # or the application's API key, alone sandbox: false # PISTE's sandbox, with the sandbox application's credentials recent: update # the date recent() reads: update (created or updated in the base) or creation resolve_references: false # labels in place of keys in the answers throttle: 0.5 # seconds between two calls (the quotas are per application, on the portal) base_uri, token_uri # to override either

Options

OptionDefault
sandboxfalse
recent'update'
resolve_referencesfalse
throttle0.5