Skip to main content

tulit, The Universal Legal Informatics Toolkit

PyPI Python Tests (status) codecov License: EUPL 1.2

tulit retrieves legislation from official sources in the EU and its Member States and turns it into legalJSON: one structured, schema-validated representation of a legal act, whatever format it was published in.

  • Retrieve documents from the EU Publications Office (Cellar) and from national and regional legislation portals.
  • Parse Formex 4, Akoma Ntoso, EUR-Lex HTML and national formats into the same structure: preface, preamble (citations and recitals), divisions, articles, paragraphs, conclusions and annexes.
  • Address divisions, articles, paragraphs and annexes with ELI-resolvable identifiers (cpt_II, art_5, par_2, anx_1), so a JSON fragment maps directly onto its ELI subdivision URI.
  • Capture amendments as structured objects (action, target act, quoted text or structure) instead of plain prose.

The Formex parser has been verified against the complete corpus of in-force EU legislation (29,790 documents): every act keeps between 97% and 103% of the source text, with no parse errors and 100% schema-valid output.

Installation

pip install tulit

tulit requires Python 3.11 or later.

Quick start

Download an EU regulation from Cellar and convert it to legalJSON:

from tulit.client.eu.cellar import CellarClient
from tulit.parser.xml.formex import Formex4Parser

client = CellarClient(download_dir="./database", log_dir="./logs")
paths = client.download(celex="32024R0903", format="fmx4")  # Interoperable Europe Act

doc = Formex4Parser().parse(paths[0]).to_dict()

article = doc["articles"][0]
print(article["eId"], article["heading"])   # art_1 Subject matter and scope

Akoma Ntoso documents are parsed the same way; the variant (AKN4EU, German LegalDocML, Luxembourg) is detected automatically:

from tulit.parser.xml.akomantoso import create_akn_parser

parser = create_akn_parser(file_path="32014L0092.akn")
doc = parser.parse("32014L0092.akn").to_dict()

Validate any output against the legalJSON schema:

from tulit.parser.parser import LegalJSONValidator

LegalJSONValidator().validate(doc)  # True

legalJSON at a glance

{
  "preface": "Regulation (EU) 2024/903 of the European Parliament and of the Council ...",
  "preamble": {
    "formula": "THE EUROPEAN PARLIAMENT AND THE COUNCIL OF THE EUROPEAN UNION,",
    "citations": [{"eId": "cit_1", "text": "Having regard to ..."}],
    "recitals": [{"eId": "rct_1", "text": "It is necessary to strengthen ..."}],
    "final": "HAVE ADOPTED THIS REGULATION:"
  },
  "structure": [
    {"eId": "cpt_1", "type": "chapter", "num": "Chapter 1",
     "children": [{"eId": "art_1", "type": "article"}]}
  ],
  "chapters": [{"eId": "cpt_1", "type": "chapter", "num": "Chapter 1", "heading": "General provisions", "parent": null}],
  "articles": [
    {"eId": "art_1", "num": "Article 1", "heading": "Subject matter and scope", "parent": "cpt_1",
     "children": [{"eId": "par_1", "text": "This Regulation lays down ...", "amendment": null}]}
  ],
  "conclusions": {"conclusion_text": "...", "signature": "..."},
  "annexes": [{"eId": "anx_1", "num": "ANNEX", "heading": "...", "children": []}]
}

chapters and articles are flat lists for easy iteration; structure holds the nested skeleton of the enacting terms. The full schema is in tulit/parser/legaljson_schema.json.

Supported sources

Jurisdiction Source Client Parsed formats
European Union Cellar / EUR-Lex CellarClient Formex 4, Akoma Ntoso (AKN4EU), XHTML, legacy HTML, legislative proposals
Finland Finlex FinlexClient Akoma Ntoso
France Légifrance LegifranceClient Légifrance JSON
Germany Rechtsinformationssystem GermanyClient LegalDocML (Akoma Ntoso)
Ireland Irish Statute Book IrishStatuteBookClient download only
Italy Normattiva NormattivaClient Akoma Ntoso
Italy (Veneto) Bollettino Ufficiale VenetoClient HTML
Luxembourg Legilux LegiluxClient Akoma Ntoso
Malta Legislation Malta MaltaLegislationClient download only
Portugal Diário da República PortugalDREClient download only
Spain BOE BOEClient BOE XML

Documentation

Full documentation is available at tulit-docs.readthedocs.io. Release notes are in CHANGELOG.md.

Development

git clone https://github.com/AlessioNar/tulit.git
cd tulit
poetry install
poetry run pytest tests/unit

End-to-end tests in tests/e2e call the live sources and need network access.

License

tulit is released under the European Union Public Licence v1.2.

Metadata

Release files for tulit 0.6.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 tulit 0.6.0
File Size Uploaded Provenance Actions
tulit-0.6.0.tar.gz 202.2 kB With provenance Details for tulit-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 429.9 kB

Release files / tulit-0.6.0.tar.gz

Download URL tulit-0.6.0.tar.gz
Size 202.2 kB
Tags Source
SHA-256 checksum
How to use checksums
767dfa8fc07bf1e2d46fec97e70090a36478f37ad1e049cd665a460e84631389
BLAKE2b-256 checksum
How to use checksums
a36cb534965387bc5260d4268bbcde4ad6e68e58fd7cb3a407431b9c41e26ed4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 17, 2026.

Transparency log

Release files / tulit-0.6.0-py3-none-any.whl

Download URL tulit-0.6.0-py3-none-any.whl
Size 227.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
542168e6c58ab639c9979238e3be25085683479567059b252ccbe125c6096b5b
BLAKE2b-256 checksum
How to use checksums
3d3d086ac7dc07e23051b7b7cc9e0f66add1710b7b84d80cb70992ba0961b2d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 17, 2026.

Transparency log

Security for tulit 0.6.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tulit-0.6.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 17, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files Full provenance

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