Skip to main content

belgica

Belgian legal reference data for Python: every court with its registries' contacts, prisons, houses of justice, judicial cantons and arrondissements, municipalities and their postal codes, and the legal and commercial interest rates. Every record says where it comes from, and the scraped data is rebuilt from the official sources every week.

The same data and helpers as the belgica npm package, with the same version number. The tests check that both give the same answers.

pip install belgica

Python 3.11 or later, no dependencies. Documentation: https://pieterjanscheir.github.io/belgica/guide/python

It's reference data, not legal advice: check the official sources before relying on it.

from belgica import (
    find_arrondissements_at,
    find_cantons_at,
    find_competent_courts,
    find_courts,
    find_courts_for_postal_code,
    get_cantons_for_municipality,
    get_contact,
    get_court,
    get_court_location,
    get_interest_rate,
    get_justice_of_the_peace,
)

get_court('court-of-appeal-brussel')['name']  # {'nl': 'Hof van Beroep Brussel', 'fr': "Cour d'appel de Bruxelles"}
get_contact(get_court('court-of-appeal-liege'), 'email', 'Greffe pénal')  # 'liege.ca.greffepenal@just.fgov.be'
find_courts(type='enterprise-court', arrondissement='west-vlaanderen')

[canton] = get_cantons_for_municipality('44088')  # merelbeke-melle
get_justice_of_the_peace(canton['id'])['address']  # where to file
get_cantons_for_municipality('44021', on='2025-09-15')  # Gent 1–5 on that day: a split city
find_cantons_at(3.7268, 51.053)  # [gent-1]: the canton of a point
find_arrondissements_at(3.7268, 51.053)  # [oost-vlaanderen]: and its arrondissement
get_court_location('justice-of-the-peace-gent-1')['geometry']  # the court on the map, a GeoJSON Point
find_competent_courts('23088', 'police-court')  # [police-court-vilvoorde]: which court, by REFNIS code
find_courts_for_postal_code('1040', 'police-court')  # per municipality: Brussel and Etterbeek share the code

get_interest_rate('2024-06-15', 'legal')  # InterestRateResult(rate=5.75, period_from='2024-01-01', period_to='2024-12-31')

The records are the dicts from the JSON files, with their keys as in the JSON (validFrom, postalCode), typed with the TypedDicts in belgica.types. Each data file is read on first use; the canton boundaries (22 MB) only by find_cantons_at and get_canton_boundary, the arrondissement boundaries only by find_arrondissements_at and get_arrondissement_boundary.

Lookups take on, a day as a datetime.date or 'YYYY-MM-DD', and answer for today without it. A day before a dataset's coverage raises a ValueError rather than answer with today's data.

Licence

Code MIT. Data CC BY 4.0: municipality, province, region and postal-code data © Statbel, canton and arrondissement boundaries and court locations © National Geographic Institute (NGI). See the repository for the sources of every dataset.

Metadata

Release files for belgica 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for belgica 0.5.0
File Size Uploaded Provenance
belgica-0.5.0.tar.gz 9.2 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for belgica 0.5.0
File Interpreter ABI Platform
belgica-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.3 MB

Release files / belgica-0.5.0.tar.gz

Download URL belgica-0.5.0.tar.gz
Size 9.2 MB
Tags Source
SHA-256 checksum
How to use checksums
61cb3afa75e24cf07a73b60b539f5702c5aa9beaeb37e45181a93498ef675350
BLAKE2b-256 checksum
How to use checksums
8948d08c65e18faf2db8eabb4fc7b427a7a3bd6337ac8c20d7a959d8c71827c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / belgica-0.5.0-py3-none-any.whl

Download URL belgica-0.5.0-py3-none-any.whl
Size 9.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
90e3690fa5a0f2c7f1efb8d3134c036e86c50a26ba5e744f8b592aea7e176165
BLAKE2b-256 checksum
How to use checksums
97acec503b8ae8b16faf00afb814839c6404f4a77e1a399c9654ee6b55e6da72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for belgica 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for belgica-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page