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

# Annexes

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

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

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

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

**Returns** `Page[AnnexSummary]`

***

### `get()`

Fetch the full content of a single annex.

```python theme={null}
annex = client.annexes.get("cra", "I")

print(annex.title)
print(annex.content)
```

**Parameters**

| Parameter        | Type  | Description                                 |
| ---------------- | ----- | ------------------------------------------- |
| `framework_slug` | `str` | Framework slug                              |
| `annex_number`   | `str` | Annex identifier, e.g. `"I"`, `"II"`, `"A"` |

**Returns** `Annex`

***

### `iter()`

Iterate over all annexes in a framework.

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

| Field            | Type          | Description                            |
| ---------------- | ------------- | -------------------------------------- |
| `id`             | `int`         | Internal numeric ID                    |
| `framework_slug` | `str`         | Parent framework slug                  |
| `annex_number`   | `str`         | Annex identifier, e.g. `"I"`           |
| `title`          | `str \| None` | Annex heading                          |
| `position`       | `int`         | Ordering position within the framework |
| `section_count`  | `int`         | Number of sections within this annex   |

### `Annex`

Returned by `get()`. Extends `AnnexSummary` with:

| Field      | Type                 | Description                          |
| ---------- | -------------------- | ------------------------------------ |
| `content`  | `str \| None`        | Full plain-text content of the annex |
| `sections` | `list[AnnexSection]` | Structured sections, if parsed       |

### `AnnexSection`

| Field            | Type  | Description                        |
| ---------------- | ----- | ---------------------------------- |
| `id`             | `int` | Internal numeric ID                |
| `section_number` | `str` | Section label, e.g. `"1"`, `"1.1"` |
| `content`        | `str` | Section text                       |
| `position`       | `int` | Ordering position within the annex |

***

## Examples

### List all CRA annexes

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

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

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

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

<Note>
  Annex numbers follow the official EU publication format. Roman numerals (`"I"`, `"II"`) are most common, but some frameworks use letters or Arabic numerals.
</Note>
