- Python 3.12+
uvpackage manager (or pip withjinja2installed)- An API snapshot (see Fetching API Metadata)
python3 compile_datasheets.py <snapshot_date> --api-snapshot <snapshot-path> [--pretty] [--output PATH] [--diff PREVIOUS_JSON]Compile for a specific release:
python3 compile_datasheets.py 2026-03-09 \
--api-snapshot metadata/api-snapshots/languagedata-20260226.json \
--prettyCustom output path:
python3 compile_datasheets.py 2026-03-09 \
--api-snapshot metadata/api-snapshots/languagedata-20260226.json \
--output /tmp/test-datasheets.json --prettyCompare with a previous release:
python3 compile_datasheets.py 2026-03-09 \
--api-snapshot metadata/api-snapshots/languagedata-20260226.json \
--diff releases/datasheets-2025-09-05.json --pretty- Loads API snapshot -- Language names, text direction, and SPS locale list from the snapshot (+ locale-extras for edge cases)
- Renders Jinja2 templates -- Flattens
base.md.j2-> child templates into flat markdown with{{KEY}}placeholders. Processes all i18n strings throughrender_inline_vars()to convert{variable}placeholders to{{KEY}}bundler markers. - Loads community content -- Reads
content/locales/with the fallback chain (modality -> shared -> defaults -> empty) - Injects OMSF funding -- For locales in
metadata/funding.tsvthat lack community-written funding content - Loads metadata -- Template-language mapping, funding info
- Outputs JSON -- Single file matching the bundler's expected schema
Before compiling, fetch a fresh API snapshot:
python3 scripts/fetch_api_metadata.pyThis fetches two endpoints:
- SCS languagedata (
/api/v1/languagedata) -- all locale metadata (names, variants, accents) - SPS locales (
/spontaneous-speech/beta/api/v1/locales) -- contributable locale codes
The snapshot is saved to metadata/api-snapshots/languagedata-{YYYYMMDD}.json.
Custom endpoints (e.g. staging):
python3 scripts/fetch_api_metadata.py --scs-url URL --sps-url URLThe compile script derives its locale lists from the API snapshot:
- SCS locales -- all locales in the snapshot (428+), including non-contributable ones
- SPS locales -- from the snapshot's
sps_localesarray (fetched from SPS API) - Edge cases --
metadata/locale-extras.jsonprovides entries for locales not in the API (e.g.el-CY,ms-MYregional codes)
There is no need to maintain a manual locale list. Any locale present in the API snapshot will get a datasheet entry.
Available template languages are auto-discovered from templates/i18n/*.json files. The compile script checks each i18n file for header_intro_scs / header_intro_sps keys to determine which modalities it supports.
Each locale defaults to en. The 13 locales that use a non-English template are listed in metadata/template-languages.json:
{ "cut": "es", "cux": "es", "hch": "es", ... }To add a new translated template, see How to Add a Translated Datasheet.
Default output: releases/datasheets-{snapshot_date}.json
The --pretty flag adds indentation for human readability.
- Fetch a fresh API snapshot:
python3 scripts/fetch_api_metadata.py - Update community content via PRs
- Compile:
python3 compile_datasheets.py {snapshot_date} --api-snapshot metadata/api-snapshots/languagedata-{YYYYMMDD}.json --pretty - Review the changelog diff (use
--diffagainst previous release) - Commit the release JSON
- Tag:
datasheets-{snapshot_date}