A Python library for programmatic access to EU official bulletins
Project description
bulletin-fetcher
Description
bulletin-fetcher is a Python library for programmatic access to legal acts published in official bulletins, with current support for the Official Journal of the European Union through the EUR-Lex / Cellar SPARQL endpoint.
The library provides a high-level Python API that allows developers, researchers and legal-domain experts to search EU legal acts without writing SPARQL queries directly.
Why bulletin-fetcher?
EU legal acts can be queried through public semantic web infrastructure, but using the underlying SPARQL endpoint requires knowledge of RDF vocabularies, query structure and EUR-Lex metadata conventions and ontologies.
bulletin-fetcher abstracts this complexity behind a simple Python interface. Users can retrieve legal acts by publication date, date ranges, act type, publishing institution and textual content, while receiving Python objects, JSON-compatible dictionaries, XML, CSV outputs or pandas DataFrames suitable for further analysis.
Main features
- Search EU legal acts from the Official Journal of the European Union.
- Filter acts by date or date range, act type, publishing institution, text contained in the act title, language.
- Fetch the content stream of an act by CELEX id or by the URI returned in search results.
- Retrieve available act types and publishing institutions.
- Return act search results as Python objects, JSON-compatible dictionaries, XML, CSV or pandas DataFrames.
- Work with Python instead of raw SPARQL queries.
- Integrate easily with notebooks, data pipelines and legal analytics workflows.
Use Cases
bulletin-fetcher can be used for:
- Legal analytics
- Public policy research
- Regulatory monitoring
- Reproducible studies based on legal acts
- Data collection pipelines
Quick Start
Installation
Install from PyPI:
pip install bulletin-fetcher
Install with all dependencies:
pip install bulletin-fetcher[all]
Basic Usage Example
Fetch acts for a publication date:
from bulletin.eurlex.api.client import EurlexBulletinClient
client = EurlexBulletinClient()
acts = client.get_acts(
date="2025-01-01",
date_end="2025-03-31",
title_contains="artificial intelligence",
language="ENG"
)
# CSV output
acts_csv = client.get_acts(
date="2025-01-01",
date_end="2025-03-31",
title_contains="artificial intelligence",
language="ENG",
output_format="csv",
)
print(f"Total acts: {len(acts)}")
if acts:
first = acts[0]
print(first.celex_uri)
print(first.title)
first_content = client.get_act_content(
first.celex_uri,
language="ENG",
)
print(first_content[:500])
content_from_celex_id = client.get_act_content(
"52025M12135",
language="ENG",
)
print(content_from_celex_id[:500])
Example scripts and notebooks
The repository includes runnable scripts and notebooks with examples and use cases of the library. These scripts can be found in the scripts/ directory.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For any questions or suggestions, feel free to reach out to the author:
- Author: Diego González Suárez
- Email: gonzalezsdiego@uniovi.es
Acknowledgements
TODO: Add acknowledgements here.
Citation
If you use bulletin-fetcher in academic work, please cite the project.
A CITATION.cff file will be added in a future release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bulletin_fetcher-0.4.1.tar.gz.
File metadata
- Download URL: bulletin_fetcher-0.4.1.tar.gz
- Upload date:
- Size: 194.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54bc929f4b519179891baa98a1a9d479dcbc49128887a8279366050e0c5d7531
|
|
| MD5 |
4ff89905e1668848e3eec5fa03afa0b1
|
|
| BLAKE2b-256 |
26dbba755dab516f90f0ec73e45284f0524b83cdc324df8c5cd5796715de2903
|
Provenance
The following attestation bundles were made for bulletin_fetcher-0.4.1.tar.gz:
Publisher:
publish.yml on diegoglezsu/bulletin-fetcher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bulletin_fetcher-0.4.1.tar.gz -
Subject digest:
54bc929f4b519179891baa98a1a9d479dcbc49128887a8279366050e0c5d7531 - Sigstore transparency entry: 1461578682
- Sigstore integration time:
-
Permalink:
diegoglezsu/bulletin-fetcher@2391096acc7f0cd910dff2aebfcf55b6da930ec2 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/diegoglezsu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2391096acc7f0cd910dff2aebfcf55b6da930ec2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bulletin_fetcher-0.4.1-py3-none-any.whl.
File metadata
- Download URL: bulletin_fetcher-0.4.1-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8453b94d1a13dd8afa690d29491f6c03ab150ba1fa435d6cf5c66425858b51de
|
|
| MD5 |
aeeab57b37eb51ff13748792f1a5718b
|
|
| BLAKE2b-256 |
c941c60affb87a041266d6b1174f565c83f90f3aeede1731e894cc8853b78d82
|
Provenance
The following attestation bundles were made for bulletin_fetcher-0.4.1-py3-none-any.whl:
Publisher:
publish.yml on diegoglezsu/bulletin-fetcher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bulletin_fetcher-0.4.1-py3-none-any.whl -
Subject digest:
8453b94d1a13dd8afa690d29491f6c03ab150ba1fa435d6cf5c66425858b51de - Sigstore transparency entry: 1461578745
- Sigstore integration time:
-
Permalink:
diegoglezsu/bulletin-fetcher@2391096acc7f0cd910dff2aebfcf55b6da930ec2 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/diegoglezsu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2391096acc7f0cd910dff2aebfcf55b6da930ec2 -
Trigger Event:
release
-
Statement type: