DEV Community

Adi CCH
Adi CCH

Posted on • Originally published at cantoncompliancehub.ch

Turning a compliance site's data layer into two open datasets

When you build an information site in a high-stakes domain, the hard part is not the prose. It is the data underneath it: the numbers that have to be right, stay right, and be traceable to something official. I have been building Canton Compliance Hub, a free multilingual resource for small businesses in Switzerland, and the most reusable thing to come out of it was not an article. It was the structured data behind them, which I have now published as two open datasets under CC BY 4.0.

Here is what they are, and the small engineering decisions that made them worth publishing.

The two datasets

Swiss minimum wage by canton. Switzerland has no national minimum wage, which surprises almost everyone hiring here for the first time. Pay floors come from three different places. Five cantons set a statutory cantonal minimum (Geneva is the highest in the world at CHF 24.59 per hour in 2026, then Basel-Stadt, Jura, Neuchatel and Ticino). Three cities set a communal minimum (Zurich, Winterthur, Lucerne). Everywhere else there is no statutory figure at all and pay is governed by sector collective agreements. The dataset captures all 26 cantons plus the three city minimums, with the legal basis and an official source URL on every row. The full comparison is on the Swiss minimum-wage-by-canton table.

Swiss SME compliance-deadline calendar. The recurring federal deadlines a small company faces across a year: quarterly VAT returns (filed within 60 days of each quarter-end), the annual AHV salary declaration, the general meeting and accounts approval within six months of the financial year-end, personal and corporate tax returns, monthly withholding tax and the 30-day dividend withholding tax. Twelve rows, each with the cadence, who it applies to, and the official source. It backs the evergreen SME compliance calendar.

Decision 1: every row cites its own source

The single rule that made this data trustworthy is that a figure with no source URL does not go in. Each row carries source_name and source_url pointing at the specific cantonal, municipal or federal page it came from, HEAD-checked to return 200. This is the same discipline the site uses internally (every rendered fact traces back to a government page), exported to the row level. It means a reuser can verify any number without trusting me, which for legal-adjacent data is the whole game.

Decision 2: two formats, not one

Each dataset ships as both CSV and JSON, and they are not the same file twice.

  • The CSV is flat, English-column, one row per canton or deadline. It opens in a spreadsheet and is what most people actually want.
  • The JSON is the source of truth and carries the full English, German and French text for every field, plus metadata the flat file drops.

A tiny build_csv.py derives the CSV from the JSON, so the flat file can never drift from the multilingual source. Edit the JSON, re-run the builder, done.

Decision 3: fold the names for portability, render them properly

The files ASCII-fold canton names (Geneve, Neuchatel, Zurich) so they survive being opened in a naive CSV reader with the wrong encoding. The live site renders the proper native spellings; the portable artifact optimises for not-getting-mangled. Small thing, but "why is my data full of question marks" is a real support cost you can design out.

Decision 4: a license that forces attribution

CC BY 4.0 is deliberate. CC BY requires attribution, which is exactly the point of publishing open data as a content site: anyone who reuses the table has to credit and link the source. The license does the link-building that the data quality earns.

Why bother

Two reasons. First, the data was already structured and grounded for the site, so exporting it was nearly free. Second, a source-linked comparison table is genuinely useful to journalists, HR teams and other builders, and useful-and-citable beats promotional every time. If you run a self-check on your own situation, the same underlying data powers a free compliance self-assessment that asks a couple of plain questions and returns a personalised overview.

If you work with open civic or compliance data and want to compare notes on grounding or formats, the datasets and the site are at cantoncompliancehub.ch. Questions welcome in the comments.

Top comments (0)