bulletin.eurlex
EUR-Lex support is split into two layers:
- API layer: high-level client and typed parsing models.
- Repository layer: connector for SPARQL query construction, endpoint communication and Cellar publication content retrieval.
- Official SPARQL Query Editor
- Official Cellar publication REST API
Basic Imports
from bulletin.eurlex.api.client import EurlexBulletinClient
from bulletin.eurlex.api.models import EurlexOfficialAct
Client
bulletin.eurlex.api.client.EurlexBulletinClient
Client to query EU Official Journal acts.
Source code in src/bulletin/eurlex/api/client.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |
get_act_content(act_id_or_uri, language=DEFAULT_LANGUAGE, max_size=None, return_bytes=False)
Fetch the publication content stream for an act.
Pass either a CELEX id (for example "52025M12135") or the full URI
returned by EurlexOfficialAct.celex_uri.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
act_id_or_uri
|
str
|
CELEX id or full resource CELLEX URI. This is not the Official Journal act number. |
required |
language
|
str
|
ISO 639-3 language code (default: "ENG"). |
DEFAULT_LANGUAGE
|
max_size
|
Optional[int]
|
Optional maximum content-stream size in bytes. |
None
|
return_bytes
|
bool
|
Return raw response bytes instead of decoded text. |
False
|
Returns:
| Type | Description |
|---|---|
Union[str, bytes]
|
The publication content decoded as html text, or bytes when return_bytes |
Union[str, bytes]
|
is True. |
Source code in src/bulletin/eurlex/api/client.py
get_acts(date, language=DEFAULT_LANGUAGE, date_end=None, title_contains=None, category_type=None, institution_type=None, output_format=None)
Fetch Official Journal acts for a given publication date.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
date
|
str
|
Publication date in ISO format (e.g. "2025-03-27"). |
required |
language
|
str
|
ISO Language code (default: "ENG"). Supported values are defined in |
DEFAULT_LANGUAGE
|
date_end
|
Optional[str]
|
End date in ISO format (e.g. "2025-03-27"). If provided, fetch acts published between |
None
|
title_contains
|
Optional[str]
|
Case-insensitive substring filter on title. |
None
|
category_type
|
Optional[str]
|
Filter by category type code (e.g. "RES" for Resolution, "ANNOUNC" for Announcement...). More types available at http://publications.europa.eu/resource/authority/resource-type. Optional. |
None
|
institution_type
|
Optional[str]
|
Filter by institution type code (e.g. "CONSIL" for Council of the European Union, "COM" for Commission...). More types available at http://publications.europa.eu/resource/authority/corporate-body. Optional. |
None
|
output_format
|
Optional[str]
|
Optional output format. Use None or "objects" to return a list of |
None
|
Returns: Acts in the requested output format.
Source code in src/bulletin/eurlex/api/client.py
get_category_types(language=DEFAULT_LANGUAGE, search=None)
Fetch the list of possible category types from the authority list. This method may last a few minutes due to the size of the authority list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
language
|
str
|
Language code (default: "ENG"). Examples: "ENG", "SPA", "FRA"... |
DEFAULT_LANGUAGE
|
search
|
Optional[str]
|
Optional case-insensitive substring filter on category type labels. |
None
|
Returns:
| Type | Description |
|---|---|
list[CategoryType]
|
A list of CategoryType objects with 'code' and 'label' attributes. |
Source code in src/bulletin/eurlex/api/client.py
get_institution_types(language=DEFAULT_LANGUAGE, search=None)
Fetch the list of possible institution types from the authority list. This method may last a few minutes due to the size of the authority list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
language
|
str
|
Language code (default: "ENG"). Examples: "ENG", "SPA", "FRA"... |
DEFAULT_LANGUAGE
|
search
|
Optional[str]
|
Optional case-insensitive substring filter on the label. |
None
|
Returns:
| Type | Description |
|---|---|
list[InstitutionType]
|
A list of InstitutionType objects with 'code' and 'label' attributes. |
Source code in src/bulletin/eurlex/api/client.py
Models
bulletin.eurlex.api.models.EurlexOfficialAct
dataclass
Source code in src/bulletin/eurlex/api/models.py
bulletin.eurlex.api.models.CategoryType
dataclass
Represents a category type (resource type) from the authority list.
Source code in src/bulletin/eurlex/api/models.py
bulletin.eurlex.api.models.InstitutionType
dataclass
Represents an institution type from the authority list.