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

Recitals are the preamble paragraphs of EU legislation. They provide interpretive context for the articles that follow and are often cited when explaining the intent behind a legal requirement. Each recital belongs to one framework.

Methods

list()

Returns a page of recitals for a framework.
page = client.recitals.list("gdpr", page=1, per_page=20)

print(f"GDPR has {page.meta.total} recitals")
for recital in page.data:
    print(f"  Recital {recital.recital_number}: {recital.content[:80]}...")
Parameters
ParameterTypeDefaultDescription
framework_slugstrrequiredFramework slug, e.g. "gdpr"
pageint1Page number
per_pageint20Items per page (1–100)
Returns Page[Recital]

get()

Fetch a single recital by its number.
recital = client.recitals.get("gdpr", 26)

print(f"Recital {recital.recital_number}")
print(recital.content)
Parameters
ParameterTypeDescription
framework_slugstrFramework slug
recital_numberintRecital number within the framework
Returns Recital

iter()

Iterate over all recitals in a framework across all pages.
for recital in client.recitals.iter("gdpr"):
    print(f"({recital.recital_number}) {recital.content[:120]}...")
Parameters — same kwargs as list() (except page). Returns Iterator[Recital]

Model

Recital

FieldTypeDescription
idintInternal numeric ID
framework_slugstrParent framework slug
recital_numberintRecital number within the framework
contentstrFull text of the recital
positionintOrdering position in the framework

Examples

from law4devs import Law4DevsClient

client = Law4DevsClient()

for r in client.recitals.iter("gdpr"):
    print(f"({r.recital_number}) {r.content}\n")

Search recital text for a keyword

keyword = "consent"
matches = [
    r for r in client.recitals.iter("gdpr")
    if keyword.lower() in r.content.lower()
]

print(f"{len(matches)} GDPR recitals mention '{keyword}':")
for r in matches:
    print(f"  Recital {r.recital_number}")

Fetch a specific recital

# Recital 26 is the famous "not a natural person" recital
r = client.recitals.get("gdpr", 26)
print(r.content)

Count recitals per framework

frameworks = list(client.frameworks.iter())
for fw in frameworks:
    page = client.recitals.list(fw.slug, per_page=1)
    print(f"{fw.short_name}: {page.meta.total} recitals")
Recitals are numbered sequentially within each framework. Recital numbers are stable and match the official EUR-Lex publication.