Code used for the open data platform | Read-only mirror of https://github.com/opendatabs/data.bs.ch — Kanton Basel-Stadt. Issues & pull requests at the source.
  • HTML 78%
  • CSS 19.8%
  • Python 2.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-24 13:22:55 +02:00
custom_views Add a comment 2026-01-28 17:00:11 +01:00
instructions Add some cosmetic changes 2021-07-06 17:31:00 +02:00
llms Add initial project structure with .gitignore, LICENSE, and Python version specification. Introduce llms.txt and related documentation files for dataset querying and management. Generate dataset indexes and context files for LLM integration. 2026-03-13 15:11:08 +01:00
look_feel/theme Fix button bug in ODS 2025-03-04 15:49:35 +01:00
pages Update url to Geodienste 2026-07-24 13:22:55 +02:00
pdfs Add 'OGD Richtlinien pdf' 2024-11-13 09:55:00 +01:00
scripts Add functionality to exclude specific documents from generated context in generate_llms_ctx.py. Update llms.txt to include a link to the Explore API v2.1 reference and OpenAPI download entrypoint. 2026-03-13 15:44:03 +01:00
workflows Add initial project structure with .gitignore, LICENSE, and Python version specification. Introduce llms.txt and related documentation files for dataset querying and management. Generate dataset indexes and context files for LLM integration. 2026-03-13 15:11:08 +01:00
.gitignore Add initial project structure with .gitignore, LICENSE, and Python version specification. Introduce llms.txt and related documentation files for dataset querying and management. Generate dataset indexes and context files for LLM integration. 2026-03-13 15:11:08 +01:00
.python-version Add initial project structure with .gitignore, LICENSE, and Python version specification. Introduce llms.txt and related documentation files for dataset querying and management. Generate dataset indexes and context files for LLM integration. 2026-03-13 15:11:08 +01:00
LICENSE Add initial project structure with .gitignore, LICENSE, and Python version specification. Introduce llms.txt and related documentation files for dataset querying and management. Generate dataset indexes and context files for LLM integration. 2026-03-13 15:11:08 +01:00
llms-ctx-full.txt Add initial project structure with .gitignore, LICENSE, and Python version specification. Introduce llms.txt and related documentation files for dataset querying and management. Generate dataset indexes and context files for LLM integration. 2026-03-13 15:11:08 +01:00
llms-ctx.txt Add initial project structure with .gitignore, LICENSE, and Python version specification. Introduce llms.txt and related documentation files for dataset querying and management. Generate dataset indexes and context files for LLM integration. 2026-03-13 15:11:08 +01:00
llms.txt Add functionality to exclude specific documents from generated context in generate_llms_ctx.py. Update llms.txt to include a link to the Explore API v2.1 reference and OpenAPI download entrypoint. 2026-03-13 15:44:03 +01:00
pyproject.toml Add initial project structure with .gitignore, LICENSE, and Python version specification. Introduce llms.txt and related documentation files for dataset querying and management. Generate dataset indexes and context files for LLM integration. 2026-03-13 15:11:08 +01:00
README.md Add initial project structure with .gitignore, LICENSE, and Python version specification. Introduce llms.txt and related documentation files for dataset querying and management. Generate dataset indexes and context files for LLM integration. 2026-03-13 15:11:08 +01:00
uv.lock Add initial project structure with .gitignore, LICENSE, and Python version specification. Introduce llms.txt and related documentation files for dataset querying and management. Generate dataset indexes and context files for LLM integration. 2026-03-13 15:11:08 +01:00

data.bs.ch website mirror + llms.txt toolkit

Repository with two responsibilities for data.bs.ch: preserving page/source assets and generating/validating LLM-facing docs.

What this repository does

  • Stores mirrored page/source code from data.bs.ch (for example pages/, look_feel/, custom_views/).
  • Publishes a concise root llms.txt router.
  • Generates dataset indexes for LLM navigation:
    • llms/datasets/index.md
    • llms/datasets/by-theme/index.md
    • llms/datasets/by-theme/*.md
    • llms/datasets/full/index.md
    • llms/datasets/full/all.md
    • llms/datasets/full/*.md
  • Generates expanded context bundles from llms.txt:
    • llms-ctx.txt (without ## Optional)
    • llms-ctx-full.txt (with ## Optional)
  • Validates required structure and links before publishing.

Architecture

  • llms.txt: root routing manifest for LLMs.
  • llms/*.md: hand-authored guides.
  • scripts/generate_dataset_docs.py: builds dataset index pages.
  • scripts/validate_llms_docs.py: checks required files/sections and link integrity.
  • .github/workflows/validate-llms-docs.yml: CI validation workflow.
  • .github/workflows/refresh-llms-datasets.yml: scheduled generation + PR workflow.

Data source strategy

scripts/generate_dataset_docs.py uses the public Explore API only:

  • https://data.bs.ch/api/explore/v2.1/catalog/datasets

Only public datasets are indexed.

Prerequisites

  • uv installed
  • Python 3.12+ (see .python-version)

Setup (uv)

uv sync

Common commands (uv)

Generate dataset docs:

uv run python scripts/generate_dataset_docs.py

Generate llms ctx artifacts:

uv run python scripts/generate_llms_ctx.py

Validate docs:

uv run python scripts/validate_llms_docs.py

CI behavior

  • Validation workflow (validate-llms-docs.yml):
    • uv sync --frozen
    • generate docs
    • validate docs and links
  • Refresh workflow (refresh-llms-datasets.yml):
    • scheduled daily
    • regenerates dataset docs and ctx artifacts
    • opens a PR with generated changes

Publish/deploy checklist

  1. Ensure root file is reachable at /llms.txt.
  2. Ensure linked docs are reachable at:
    • /llms/getting-started.md
    • /llms/odsql-cheatsheet.md
    • /llms/query-cookbook.md
    • /llms/datasets/index.md
  3. Run local generate + validate commands.
  4. Confirm CI passes.
  5. Spot-check a few generated theme pages and dataset rows.

Troubleshooting

  • Missing required root links in validator
    • Ensure llms.txt includes absolute URLs for all critical docs.
  • Broken local links
    • Run validator and fix target paths in markdown.
  • Dataset count changes unexpectedly
    • Verify portal availability and Explore API connectivity.