Skip to main content

Module legislation_ingest

Module legislation_ingest 

Source
Expand description

Native legislation structure parse → hypermedia Library ingest.

Ports the structural (no-LLM) path of tools/legislation-etl/legis2cml.py: Part / Division / Schedule / Section / Subsection decomposition, then seeds each provision as a findable Library entry under Work with purpose legislation. Full section body text is always stored (the Python ETL used to drop bodies from N3/JSON-LD — this path does not).

PDF → text uses pdf_extract (already a client-core dependency).

Structs§

LegislationIngestReport
LegislationInstrument
Provision

Constants§

LEGISLATION_INSTRUMENT_MEDIA
LEGISLATION_MEDIA_TYPE
Media type for native legislation provision entries.

Functions§

extract_pdf_pages
Extract text pages from a PDF file.
extract_pdf_pages_from_bytes
ingest_legislation_pdf_bytes
Parse PDF bytes and seed the library.
ingest_legislation_text
Parse plain text (already extracted) as a single-page instrument and seed.
parse_pages
Parse legislation pages into structured provisions (AU-oriented; EU Article/Chapter supported).
seed_instrument_into_library
Seed a parsed instrument into the hypermedia library (instrument + every provision).