> ## 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.

# Recitals

> Fetch and iterate framework recitals with the Law4Devs Python SDK.

## 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.

```python theme={null}
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**

| Parameter        | Type  | Default  | Description                   |
| ---------------- | ----- | -------- | ----------------------------- |
| `framework_slug` | `str` | required | Framework slug, e.g. `"gdpr"` |
| `page`           | `int` | `1`      | Page number                   |
| `per_page`       | `int` | `20`     | Items per page (1–100)        |

**Returns** `Page[Recital]`

***

### `get()`

Fetch a single recital by its number.

```python theme={null}
recital = client.recitals.get("gdpr", 26)

print(f"Recital {recital.recital_number}")
print(recital.content)
```

**Parameters**

| Parameter        | Type  | Description                         |
| ---------------- | ----- | ----------------------------------- |
| `framework_slug` | `str` | Framework slug                      |
| `recital_number` | `int` | Recital number within the framework |

**Returns** `Recital`

***

### `iter()`

Iterate over all recitals in a framework across all pages.

```python theme={null}
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`

| Field            | Type  | Description                         |
| ---------------- | ----- | ----------------------------------- |
| `id`             | `int` | Internal numeric ID                 |
| `framework_slug` | `str` | Parent framework slug               |
| `recital_number` | `int` | Recital number within the framework |
| `content`        | `str` | Full text of the recital            |
| `position`       | `int` | Ordering position in the framework  |

***

## Examples

### Print all GDPR recitals

```python theme={null}
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

```python theme={null}
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

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

### Count recitals per framework

```python theme={null}
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")
```

<Note>
  Recitals are numbered sequentially within each framework. Recital numbers are stable and match the official EUR-Lex publication.
</Note>
