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

Frameworks are the top-level resource — every article, recital, requirement, and annex belongs to one. Use the client.frameworks resource to query them.

Methods

list()

Returns the first page of frameworks.
page = client.frameworks.list(page=1, per_page=20)

print(page.meta.total)   # total number of frameworks
for fw in page.data:
    print(fw.slug, fw.name)
Parameters
ParameterTypeDefaultDescription
pageint1Page number
per_pageint20Items per page (1–100)
Returns Page[Framework]

get()

Fetch a single framework by its slug.
fw = client.frameworks.get("gdpr")

print(fw.name)            # "General Data Protection Regulation"
print(fw.eurlex_url)      # "https://eur-lex.europa.eu/..."
print(fw.requirement_count)
print(fw.coverage)        # dict with sync coverage info
Parameters
ParameterTypeDescription
slugstrFramework slug, e.g. "gdpr", "cra", "nis2"
Returns FrameworkDetail

iter()

Iterate over every framework across all pages without manual pagination.
for fw in client.frameworks.iter():
    print(fw.slug, fw.name)
Parameters — same kwargs as list() (except page, which is managed internally). Returns Iterator[Framework]

Models

Framework

Returned by list() and iter().
FieldTypeDescription
idintInternal numeric ID
slugstrURL-safe identifier, e.g. "gdpr"
namestrFull official name
short_namestrAbbreviated name, e.g. "GDPR"
celex_numberstr | NoneEUR-Lex CELEX identifier
descriptionstr | NonePlain-text summary
is_activeboolWhether the framework is in force
statusstr"active", "draft", or "superseded"
expected_articlesint | NoneKnown article count from official text
expected_recitalsint | NoneKnown recital count
last_synced_atstr | NoneISO 8601 timestamp of last data sync
created_atstrISO 8601 timestamp of record creation
article_countintArticles currently in the database
recital_countintRecitals currently in the database

FrameworkDetail

Returned by get(). Extends Framework with:
FieldTypeDescription
eurlex_urlstr | NoneCanonical EUR-Lex URL
requirement_countintParsed compliance requirements
annex_countintAnnexes in the database
tag_countintTags applied to this framework’s content
coveragedictSync coverage statistics

Examples

from law4devs import Law4DevsClient

client = Law4DevsClient()

print(f"{'Slug':<12} {'Name':<45} {'Articles':>8} {'Status'}")
print("-" * 75)

for fw in client.frameworks.iter():
    print(f"{fw.slug:<12} {fw.name:<45} {fw.article_count:>8} {fw.status}")

Filter active frameworks only

active = [fw for fw in client.frameworks.iter() if fw.status == "active"]
print(f"{len(active)} active frameworks")

Inspect a framework’s coverage

fw = client.frameworks.get("cra")
print(f"CRA: {fw.article_count}/{fw.expected_articles} articles synced")
print(f"     {fw.recital_count}/{fw.expected_recitals} recitals synced")

Look up a framework by short name

all_frameworks = list(client.frameworks.iter())
match = next((f for f in all_frameworks if f.short_name == "NIS2"), None)
if match:
    print(match.slug)  # "nis2"
Framework slugs are stable identifiers — safe to hardcode in your application. They will not change between API versions.
Some frameworks have status="superseded" (e.g. NIS1). The data is still accessible and browsable, but these frameworks are no longer in force.