Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.law4devs.eu/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Annexes are supplementary parts of EU legislation, often containing technical specifications, lists, or tables that are referenced within the articles. Each annex belongs to one framework and is identified by its annex number (or letter, e.g. "I", "II", "A").

Methods

list()

Returns a page of annex summaries for a framework.
page = client.annexes.list("cra", page=1, per_page=20)

print(f"CRA has {page.meta.total} annexes")
for annex in page.data:
    print(f"  Annex {annex.annex_number}: {annex.title}")
Parameters
ParameterTypeDefaultDescription
framework_slugstrrequiredFramework slug, e.g. "cra"
pageint1Page number
per_pageint20Items per page (1–100)
Returns Page[AnnexSummary]

get()

Fetch the full content of a single annex.
annex = client.annexes.get("cra", "I")

print(annex.title)
print(annex.content)
Parameters
ParameterTypeDescription
framework_slugstrFramework slug
annex_numberstrAnnex identifier, e.g. "I", "II", "A"
Returns Annex

iter()

Iterate over all annexes in a framework.
for annex in client.annexes.iter("cra"):
    print(f"Annex {annex.annex_number}: {annex.title}")
Parameters — same kwargs as list() (except page). Returns Iterator[AnnexSummary]

Models

AnnexSummary

Returned by list() and iter().
FieldTypeDescription
idintInternal numeric ID
framework_slugstrParent framework slug
annex_numberstrAnnex identifier, e.g. "I"
titlestr | NoneAnnex heading
positionintOrdering position within the framework
section_countintNumber of sections within this annex

Annex

Returned by get(). Extends AnnexSummary with:
FieldTypeDescription
contentstr | NoneFull plain-text content of the annex
sectionslist[AnnexSection]Structured sections, if parsed

AnnexSection

FieldTypeDescription
idintInternal numeric ID
section_numberstrSection label, e.g. "1", "1.1"
contentstrSection text
positionintOrdering position within the annex

Examples

List all CRA annexes

from law4devs import Law4DevsClient

client = Law4DevsClient()

for annex in client.annexes.iter("cra"):
    print(f"Annex {annex.annex_number}: {annex.title or '(untitled)'} ({annex.section_count} sections)")

Read the full content of an annex

annex = client.annexes.get("cra", "I")

print(f"=== {annex.title} ===\n")
if annex.sections:
    for section in annex.sections:
        print(f"\n{section.section_number}. {section.content}")
else:
    print(annex.content)

Check which frameworks have annexes

for fw in client.frameworks.iter():
    detail = client.frameworks.get(fw.slug)
    if detail.annex_count > 0:
        print(f"{fw.short_name}: {detail.annex_count} annexes")

Collect all annex content for a framework

all_content = []
for annex in client.annexes.iter("gdpr"):
    full = client.annexes.get("gdpr", annex.annex_number)
    all_content.append({
        "annex": annex.annex_number,
        "title": annex.title,
        "content": full.content,
    })

print(f"Fetched {len(all_content)} GDPR annexes")
Annex numbers follow the official EU publication format. Roman numerals ("I", "II") are most common, but some frameworks use letters or Arabic numerals.