Skip to main content

A Python library for programmatic access to EU official bulletins

Project description

bulletin-fetcher

Tests CodeQL Quality Gate Status Codecov status PyPI version Documentation DOI

Description

Bulletin Fetcher Logo

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"
)

print(f"Total acts: {len(acts)}")
if acts:
    first = acts[0]
    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])

Use Case Examples

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:

Acknowledgements

The authors gratefully acknowledge the financial support of the Asturian Agency for Science, Business Competitiveness and Innovation (SEKUENS) under Grant Agreement No. SEK-25-GRU-GIC-24-018. Noelia Rico and Irene Díaz also acknowledge support from the European project SCIMIN-CRM (Grant Agreement No. 101177746) and the funding from the Spanish Ministry of Science and Innovation through project PID2022-139886NB-I00.

Citation

If you use bulletin-fetcher in your research, please cite it. Citation information is available in the CITATION.cff file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bulletin_fetcher-0.4.5.tar.gz (373.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bulletin_fetcher-0.4.5-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file bulletin_fetcher-0.4.5.tar.gz.

File metadata

  • Download URL: bulletin_fetcher-0.4.5.tar.gz
  • Upload date:
  • Size: 373.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bulletin_fetcher-0.4.5.tar.gz
Algorithm Hash digest
SHA256 ed02d68ff30d1b2077eb7d527a4dd4599a16b38f3c531169ec7e511081a493bb
MD5 405cb3ea2c009dec5cb28b544d6ea276
BLAKE2b-256 0929ec69af69cbe9b866b578efc35863cdcc5f3d17f9ad7037c8f99cad684e7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for bulletin_fetcher-0.4.5.tar.gz:

Publisher: publish.yml on diegoglezsu/bulletin-fetcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bulletin_fetcher-0.4.5-py3-none-any.whl.

File metadata

File hashes

Hashes for bulletin_fetcher-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d245b872f42688858819906b0886f3d3bc696ff5eefc04483e0cca9de26e6537
MD5 f1b0f133ccbc5f5881124315e9eb53ef
BLAKE2b-256 d8e969d85f4c2392a9501c9a5b39a98e4c053091b7dd0b9773e4ad45d013af23

See more details on using hashes here.

Provenance

The following attestation bundles were made for bulletin_fetcher-0.4.5-py3-none-any.whl:

Publisher: publish.yml on diegoglezsu/bulletin-fetcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page