This repository collects the government domain names of 197 States and entities, so we can measure how much governments contribute to publicly available software archived by Software Heritage.
197 jurisdictions, each tagged with its UN status:
- 193 UN member states
- 2 UN observer states: Holy See, Palestine
- 2 non-UN entities: Taiwan, Kosovo (kept for context, but excluded from any UN-facing aggregation).
We sort government domains into levels:
central– the central government: ministries, national agencies (including national research bodies: CNRS, CNR…) and the root domains that stand for them (gouv.fr,gov.uk).central-1– the first administrative tier below: state, Land, region… (sp.gov.br,nouvelle-aquitaine.fr).- the rest – everything lower (municipalities, counties, parishes…), kept out of the lists and regexes.
Universities are out of scope: the strictly public ones (Wikidata
public / public-research / national university classes) are kept as a
parked dataset in data/public-universities.csv, refreshed by
scripts/detect-universities.clj (bb universities), for a possible
later re-exploration. Nothing in the pipeline reads that file.
We proceed by lists of domain names and subdomains, one country at a
time. The situation varies from country to country: where each level
has its own roots, the lists are enough; but where everything under a
single root like gov.br would also include local levels, a curated
list (sources/registry/excluded-labels.csv) excludes the local
levels when needed.
Three ready-to-use CSV files, covering UN members and observers only:
data/public-sector-domains.csv– every government host we found, apex domains and subdomains (e.g.gouv.fr,beta.gouv.fr).data/public-sector-domains-central.csv– one row per central-government root domain (e.g.gouv.fr,insee.fr). A root already stands for all its subdomains, so this is the short list of email domains to watch.data/public-sector-domains-central+.csv– the central roots (levelcentral) plus the bodies of the first administrative tier below (levelcentral-1: Land, state, region…). Central-1 rows only enter once confirmed, mirroring the manual gate of the central level: either through a curated registry (Brazilian/Australian states, UK devolved bodies;sourcesisregistry) or through the per-country curation channel (sources/curated/central_admin.csv;sourcesincludescurated). Unconfirmed central-1 candidates stay incandidates-local.csv– that file is the curation worklist.
Each row carries metadata: UN status, region, languages and GDP
One directory per country (FRA_france, USA_united_states, …), with:
subdomains.csv– all known subdomains and their HTTP status.candidates.csv– central administration domains not confirmed yet, scored 0 to 10 by how many sources agree.candidates-local.csv– same for domains attributed to subnational administrations; thelevelcolumn separatescentral-1(bodies of a first-level subdivision: Land, state, region…) fromlocal(the rest). Central-1 rows enter the central+ scope once curated.summary.md– a human-readable cross-check report.sources/– the raw data behind the above, one folder per source.sources/linkgraph/indegree.csv(EU + neighbours only) counts, for each domain, how many distinct public-sector domains of the same country link to it, from the crawl published by eu-plus-government-scans (bb indegreerefreshes it); well-linked hosts entercandidates.csvwith a strong score bonus.
world-governments.csv– the master list of the 197 countries.forge-candidates.csv– hosts that look like software forges or source-code catalogs (git.*,gitlab.*,forge.*,code.*, …), extracted from the harvested subdomains; leads for the swh-sopc-data-sources catalog list.known-forges.csv– curated list of self-hosted government forges (GitLab, Forgejo…), seeded from the swh-sopc-data-sources catalog list.known-catalogs.csv– curated list of government source-code catalogs (portals pointing at code hosted elsewhere), same columns; kept for reference, never searched.github-gov-orgs.csv– government GitHub organizations from GitHub’s community-maintained governments.yml, plus the local additions ofgithub-gov-orgs-extra.csv(orgs not merged upstream yet).forge-unknown-swh.csv– forge targets (harvested + curated) that the Software Heritage archive does not know yet (checked against its origin-search API): candidates for archival. Each target is also probed over HTTPS:forge_typeis the forge software sniffed from the homepage (gitlab, gitea, cgit…, orgithubfor redirects),http_statusthe final HTTP code (000when unreachable) andnotea short diagnostic (DNS failure, timeout, WAF, default page, cross-host redirect).bb forges forges-proberefreshes these columns without re-querying the SWH API. The whole forge/catalog channel lives inscripts/detect-forges.clj: it shares this repository’s harvested data but serves the Software Heritage catalog goal, not the domain-regex goal.domain-regexes.csv(andpublic-sector-domains-central+-regex.txt) – per-country (and global) email-domain regexes over the central+ scope (central government plus the first subdivision tier, i.e.public-sector-domains-central+.csv), ready for thedomain_regexsetting of swh-institutional-analysis. On mixed suffixes (gov.uk,gov.br=…), subtrees below the first tier are kept out via curated exclusions (see =scripts/README.org).- A few generated mapping files linking country names to source IDs.
- crt.sh – subdomains seen in public TLS certificates (main harvest).
- HTTPS probes – check that a host actually serves content.
- Wikidata – ministries, parliaments, central banks, courts and their official websites.
- IANA, UN/DESA, CIA World Factbook, OECD – other official sources used to cross-check candidates.
- Official directories of public bodies (
bb directories harvest, declarative specs inscripts/detect-from-directories.clj) – the per-country directories listed in swh-sopc-data-sources. When the directory’s central scoping is authoritative (Norway’s Enhetsregisteret, sector 6100) its domains enter the registry channel directly; when levels or types are mixed (Germany’s Behördenwegweiser) its hosts feedcandidates.csvwith a strong score bonus and thedirectorysource tag, and curation decides.
See swh-sopc-data-sources for a list of all data sources used in the final State of Public Code.
Everything is driven by Babashka through bb.edn tasks.
# Install Babashka (Linux / macOS)
bash <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)
# From the repository root:
bb pipeline help # list all sub-commands
bb pipeline all # full run: collect + enrich + reportSee scripts/README.org for the full command reference, scoring rules
and environment variables.
See AI_policy.md.
This repository uses Conventional Commits.
Please don’t push changes directly: create tickets and merge requests or send me patches.
When in doubt, please get in touch: bastien.guerry@inria.fr
If you know the public administration of a country, you can help verify that our inclusions and exclusions are right:
data/public-sector-domains-central+.csv– are thecentralandcentral-1rows really the central government and the first tier below it?countries/<ISO3>_<slug>/candidates.csvandsummary.md– did we miss or misclassify domains?candidates-local.csvholds what we set aside as subnational.countries/<ISO3>_<slug>/sources/registry/excluded-labels.csv– for shared roots likegov.br: is the list of excluded labels complete and correctly tagged (central-1vslocal)? Corrections go inexcluded-labels-extra.csv, which generated files never overwrite.- First-tier bodies hosted inside an excluded subtree (a state agency
such as
educacao.sp.gov.br) match nothing until listed explicitly: telling us about them is especially useful.
Please email me at bastien.guerry@inria.fr if you have questions and
suggestions that don’t fit in a ticket or merge request.
Data are published under the CC0 1.0 license; code under the EPL 2.0 license.