Two official Python libraries for working with European Union institutional data through Brubru, by Beresol BV.
- brubru: the official client for the Brubru EU Data API. It gives you the whole EU institutional data estate behind one key (legislation, procedures, institutions, the social directory, and the input-first extract engine) on a single five-datapoint contract.
- brubru-eurovoc (import name
eurovoc): a standalone, open-source EuroVoc classifier. It tags any text into the EU's official subject space (7,029 descriptors, 127 microthesauri, 21 domains), multilingual including Catalan. A modern successor to the 2021 PyEuroVoc package.
The Brubru EU Data API itself is documented at https://brubru.beresol.eu/api/docs
pip install brubru
pip install "brubru-eurovoc[local]" # [local] adds the classifier modelimport brubru
bru = brubru.Client(api_key="brubru_live_...")
# Extract structured items from any EU institutional URL, optionally EuroVoc-tagged
res = bru.extract("https://cinea.ec.europa.eu/news-events/news_en", classify=True)
for item in res:
print(item.document_date, item.title, item.public_url)
# Recent posts from a mapped entity (MEP, Commissioner, institution, journalist)
posts = bru.social.posts(entity_type="commissioner", platform="x", limit=20)Get an API key on the Professional subscription, or contact hello@beresol.eu.
import eurovoc
for d in eurovoc.classify("Markets in crypto-assets regulation"):
print(d.label, "|", d.domain, d.domain_label, "|", round(d.score, 3))The two libraries interoperate: enrich the descriptors the API returns with eurovoc.from_descriptors(...), or classify a live EU URL through the hosted engine with eurovoc.classify_url(...).
brubru/ the brubru SDK (distribution: brubru)
eurovoc/ the EuroVoc classifier (distribution: brubru-eurovoc, import: eurovoc)
Each package has its own README, pyproject.toml and tests.
cd brubru && pip install -e ".[test]" && pytest -m "not live"
cd eurovoc && pip install -e ".[test,local]" && pytest -m "not model"MIT. See LICENSE. Built by Beresol BV. EuroVoc is a trademark of the Publications Office of the European Union.