
Andorra public sources
io.github.joalavedrav0.2.0更新于 Oct 4, 2026
Andorra public data: BOPA bulletin, statistics, maps, e-tramits procedures and govern.ad pages
概览
让助手搜索并引用安道尔公共来源,如 BOPA 公报、统计数据、地图、办事流程和政府页面。
- 功能
- 一个用于查询安道尔公共来源的教育性目录和 Python 客户端。它记录端点形式、复用条款和实际陷阱,并通过 MCP 服务器和带引用的助手暴露部分实时数据。检索使用本地 BM25 索引,仅包含办事流程和政府页面的标题、URL 和章节标题,匹配的页面正文实时抓取并引用。来源包括 BOPA、统计数据、e-tramits 办事流程、govern.ad 页面、ArcGIS 地理数据、燃料价格、订阅源和透明度数据。
- 适用场景
- 适合助手需要带引用地回答有关安道尔立法、官方统计、政府办事流程或公共服务的问题。面向研究和教育用途,而非对来源材料的商业再发布。
- 运行要求
- 作为 Python 包(fonts-andorra)通过 stdio 在本地运行,需要 Python 3.10 或更高版本,可用 pip 或 uvx 安装。未声明身份验证。可选的带引用问答助手需要 GEMINI_API_KEY 环境变量。抓取实时页面和数据需要网络访问。
安装
在 SourceWeft 中
- 打开 控制台中的 Andorra public sources,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Andorra public sources
An educational catalog and small Python clients for finding and querying public sources in Andorra. It documents the endpoint shapes, reuse terms, verified behavior and practical traps, then exposes selected live data through Python, an MCP server and a cited assistant.
Aquest projecte educatiu reuneix fonts públiques d'Andorra, amb exemples i clients per consultar-les. És independent i no està afiliat al Govern d'Andorra.
This project adapts ideas and code from BquantFinance/Administracion-fuentes-publicas, an upstream project released under CC0-1.0.
Independent educational project. Not affiliated with the Govern d'Andorra or any listed institution.
Sources
Quickstart
Python 3.10 or newer:
The MCP server communicates over stdio. Configure Claude Desktop, Claude Code or Cursor with the installed command:
Install the MCP server
Run the published server with uvx:
Claude Desktop configuration:
Ask a cited question using Gemini REST. Set GEMINI_API_KEY in the environment; it is never stored in this repository:
The clients can also be imported directly:
Source data terms
This repository's own code and catalog are dedicated to the public domain under CC0-1.0. That does not relicense the source material:
- BOPA permits copying, adaptation, extraction and redistribution subject to its conditions: preserve source and update metadata, do not distort meaning, and do not imply endorsement.
- Statistics data owned by the Department of Statistics is CC BY 4.0; third-party data may have separate terms.
- govern.ad, e-tramits and Transparency are all-rights-reserved Government content. The project fetches page bodies live, cites and links them, and does not redistribute their content. Written consent is required for republication. The Govern local index contains only titles, URLs and section headings.
- ArcGIS and fuel layers are treated as all-rights-reserved Govern content because item-level licenses were not stated; this project fetches them live, cites links and does not redistribute their content.
- Feeds, meteo.ad and CASS: item-specific terms are absent or were not checked; review the publisher's terms before redistributing data.
The catalog marks sources and terms individually. Verify the terms that apply to each item before using it commercially or republishing it.
Catalog files
sources/<id>.yamlcontains the source fiches.schema/source.schema.jsonandschema/vocab.yamldefine the fiche contract and closed vocabularies.indices/dead-routes.yamllists unresolved domains checked on 2026-10-02.catalog.json,llms.txtandllms-full.txtare generated bypython scripts/build.py.python scripts/validate.pychecks source schema, vocabularies and related source IDs.
Local search index
fonts_andorra/data/index.json contains e-tramits titles and URLs, plus Govern page titles, URLs and section headings only; all page bodies are fetched live and cited because the source content is all rights reserved. Assistant procedure and Govern retrieval use local BM25 search and fetch matching pages live; Govern's disallowed site search is not used.
Rebuild it from live e-tramits and the Catalan Govern sitemap with .venv/bin/python scripts/build_index.py; this networked builder is intentionally not part of CI.
Tests
The test suite is offline and uses saved public response fixtures:
CI
ci.yml runs lint, offline tests, validation and generated-file checks on pushes and pull requests; live.yml runs weekly live checks and uploads a report.
The assistant check in live.yml requires a repository GEMINI_API_KEY secret.
Assistant evaluation
evals/procedures.yaml has 10 real procedures with ground truth (price, maximum resolution time, application period, in-person requirement) taken from the live e-tramits pages on 2026-10-02. Run it with:
Latest result (evals/results-2026-10-03.md, gemini-2.5-flash): 10/10 cases pass with the right procedure cited and 18/18 facts correct. The same model answering closed-book got 3/18 facts. These 10 cases were also used while tuning retrieval, so treat this as a regression set rather than a held-out benchmark.
Held-out set
evals/heldout.yaml has 20 more cases written after tuning ended: 15 procedures not used for tuning (ca/es/fr/en) and 5 questions no source here can answer (weather, ski pass prices, border queues, a minister's personal phone, the user's own vacation days), which must be declined without stating any amount.
- First run (
evals/results-heldout-2026-10-03-first-run.md): 15/20 as scored. Three failures were scorer bugs (citations written as[1, 2]were not parsed, and "no se encontró" was not recognised as declining). Rescoring the same answers gives 18/20. The two real failures:- The redactor masked dates such as
23-09-2026as phone numbers, so the assistant could not state an application period. Now fixed. - For "I'm selling my flat and need the habitability certificate", it answered from the cèdula d'habitabilitat (2 months) instead of the certificat d'habitabilitat (72 hours). The question is arguably ambiguous, since a sale needs the cèdula.
- The redactor masked dates such as
- After the fixes (
evals/results-heldout-2026-10-03.md): 20/20, 23/23 facts, 5/5 unanswerable questions declined, 0 bad citations. The same model closed-book got 6/23 facts. The habitability case passed because retrieval returned a different set of procedures, not because of a fix. Keyword generation is not fully deterministic, so expect that case to flip.
From here this set is no longer strictly held out: one bug fix was found with it. New failures should be fixed against new cases.
The one-page proposal for the Govern is in docs/pitch.md.
来源:README.md,提交 eac07dd
工具
0版本历史
1- v0.2.0最新Oct 4, 2026


