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

Articles are the primary legal content of each framework. Every article belongs to exactly one framework, identified by its framework_slug. Use client.articles to list, fetch, and navigate them.

Methods

list()

Returns a page of article summaries for the given framework.
page = client.articles.list("gdpr", page=1, per_page=20)

print(f"GDPR has {page.meta.total} articles")
for article in page.data:
    print(f"  Art. {article.article_number}: {article.title}")
Parameters
ParameterTypeDefaultDescription
framework_slugstrrequiredFramework slug, e.g. "gdpr"
pageint1Page number
per_pageint20Items per page (1–100)
Returns Page[ArticleSummary]

get()

Fetch the full content of a single article, including all paragraphs.
article = client.articles.get("gdpr", 17)

print(article.title)
print(article.content)

for para in article.paragraphs:
    print(f"  §{para.paragraph_number}: {para.content}")
Parameters
ParameterTypeDescription
framework_slugstrFramework slug
article_numberintArticle number within the framework
Returns Article
Fetch articles related to a given article (linked via shared requirements or tags).
page = client.articles.related("gdpr", 17)

for article in page.data:
    print(f"  Related: Art. {article.article_number}{article.title}")
Parameters
ParameterTypeDefaultDescription
framework_slugstrrequiredFramework slug
article_numberintrequiredArticle number
pageint1Page number
per_pageint20Items per page (1–100)
Returns Page[ArticleSummary]

iter()

Iterate over all articles in a framework across all pages.
for article in client.articles.iter("gdpr"):
    print(f"Art. {article.article_number}: {article.title}")
Parameters — same kwargs as list() (except page). Returns Iterator[ArticleSummary]

Models

ArticleSummary

Returned by list(), related(), and iter().
FieldTypeDescription
idintInternal numeric ID
framework_slugstrParent framework slug
article_numberintArticle number within the framework
titlestr | NoneArticle heading
positionintOrdering position in the framework
paragraph_countintNumber of paragraphs
tagslist[str]Tag slugs applied to this article

Article

Returned by get(). Extends ArticleSummary with:
FieldTypeDescription
contentstr | NoneFull plain-text content of the article
paragraphslist[Paragraph]Ordered list of paragraph objects

Paragraph

FieldTypeDescription
idintInternal numeric ID
paragraph_numberstrLabel, e.g. "1", "2a", "intro"
contentstrParagraph text
positionintOrdering position within the article

Examples

Print every GDPR chapter with article titles

from law4devs import Law4DevsClient

client = Law4DevsClient()

for article in client.articles.iter("gdpr"):
    print(f"Art. {article.article_number:>3}  {article.title or '(untitled)'}")

Fetch a specific article and display it

article = client.articles.get("gdpr", 17)

print(f"Article {article.article_number}: {article.title}")
print("=" * 60)
for para in article.paragraphs:
    print(f"\n({para.paragraph_number}) {para.content}")

Find all articles tagged with a specific tag

tagged = [
    a for a in client.articles.iter("gdpr")
    if "data-breach" in a.tags
]
print(f"{len(tagged)} articles tagged 'data-breach'")
article = client.articles.get("gdpr", 33)  # Personal data breach notification

related = client.articles.related("gdpr", 33)
print(f"Art. 33 is related to {related.meta.total} other articles:")
for r in related.data:
    print(f"  Art. {r.article_number}: {r.title}")

Collect all articles into a dict for fast lookup

articles_by_number = {
    a.article_number: a
    for a in client.articles.iter("cra")
}

print(articles_by_number[10].title)
Use iter() when you need every article. Use list() when you only need one page or want to control pagination yourself.