For the volunteers and maintainers who keep the boring data accurate.
For every developer who has ever fixed a country list at 2 AM. For every civic technologist who has scraped a government website because the data should have been public.
Facts are infrastructure.
There is a category of software infrastructure that almost no one talks about: the small, structured, factual data files that make the rest of the internet work.
I am talking about files like countries.json (a list of every country, with ISO codes, currencies, capitals, phone codes). Files like currencies.json (every world currency, with exchange rate metadata, subunit information, symbols). Files like languages.json (ISO 639 language codes and names). Files like timezones.json, postal-code-regexes.json, holidays.json, tax-rates.json, airports.json, medical-codes.json, zip-codes.json, unit-conversions.json, ng-counties.json, za-provinces.json, zw-districts.json.
These files are not glamorous. They are not "artificial intelligence." They are not distributed systems, blockchains, or real-time data pipelines. They are static JSON (or CSV, or YAML, or XML) files — structured collections of facts about the world, stored in a format computers can read, version-controlled, maintained, and published for other software to depend on.
And yet almost every non-trivial software application depends on at least one of these files. If you have ever filled out a country dropdown on a web form, you have used countries.json. If you have ever been shown a price in your local currency, that is currencies.json at work. If you have ever seen a public holiday marked on a calendar, that is holidays.json. If you have ever been asked for your postal code and the form validated it, that is postal-code-regexes.json. These files are everywhere; they are invisible; they are critical infrastructure; and they are surprisingly poorly made.
This book is about why these facts-as-data-files matter, why they are a form of infrastructure as critical as DNS or TLS or open-source libraries, why most of them are badly maintained, out of date, incomplete, wrong, unversioned, or paywalled, and how we can build them properly — as open data, version-controlled, well-maintained, tested, validated, and treated with the same engineering rigour we apply to any other critical software dependency.
I have spent years building and maintaining this kind of data infrastructure for African markets — where the problem is most acute because most public data files are built from a Western perspective and either omit African countries, get them wrong, or treat them as afterthoughts. I maintain zw-districts.json (a structured list of Zimbabwe's 10 provinces and 64 districts with administrative codes, coordinates, and population estimates), zw-schools.json (a list of all registered primary and secondary schools in Zimbabwe), african-currencies.json (currency metadata for all 54 African countries with current exchange-rate regimes and mobile-money integrations), african-mobile-operators.json (MNO metadata, USSD codes, M-Pesa-style integrations), and several others. These files are published as open data under CC BY licenses, versioned on GitHub, validated with CI, and depended on by fintechs, edtechs, health-techs, and government systems across southern Africa.
In this book I argue: - Structured factual data files are infrastructure. They should be engineered, maintained, and respected as such. - Most reference data files are terrible — incomplete, outdated, unmaintained, wrong, paywalled, or lacking provenance. - Building good ones is a solvable engineering problem: schemas, validation, testing, versioning, attribution, and governance. - For Africa and the global periphery, building and maintaining these reference datasets is a prerequisite for functioning software ecosystems. You cannot build reliable fintech if your currency data is wrong. You cannot build reliable health systems if your medical facility list is three years out of date. You cannot build edtech if your school registry is incomplete. - These files should be open, public, freely reusable, and maintained as public goods. Locking reference facts about the world behind paywalls is rent-seeking on public knowledge.
This book covers: - Part I: Why facts.json is infrastructure — the country dropdown problem, reference data as critical infrastructure, the structural problems with how public data is maintained today. - Part II: How to build good facts.json — schemas, sourcing, provenance, validation, versioning, distribution. - Part III: Specific datasets — countries, currencies, subnational divisions, the African data gap. - Part IV: Governance and community — maintenance, sustainability models, open licensing. - Part V: Using facts.json in production — how to depend on reference data responsibly, how to publish for consumers, the open data flywheel. - Part VI: Call to build — what is missing today, facts as a commons, why African developers must build our own data infrastructure. - Part VII: Case studies — zw-districts.json, the IANA Time Zone Database, holiday data, school registries. - Part VIII: Technical implementation — writing schemas, CI pipelines, repository structure, publishing to package managers, APIs.
This is a technical book, but it is short (~80 pages) and practical. It is written for developers who build and use these kinds of files, for data engineers, for civic technologists, for open-data advocates, for governments thinking about publishing public data, and for anyone who believes that basic factual data about the world should be accurate, accessible, and free.
This book is published under the Creative Commons Attribution 4.0 International License (CC BY 4.0). You are free to share (copy and redistribute in any medium or format) and adapt (remix, transform, and build upon the material) for any purpose, even commercially, as long as you give appropriate credit, provide a link to the license, and indicate if changes were made.
The code examples and data structures described in this book are released under CC0 (public domain dedication) — use them freely without restriction or attribution, though attribution is appreciated.
Open almost any registration form, checkout page, address form, or signup flow on the internet and you will find a country dropdown: a list of countries to select from. Where does that list come from?
If you are a developer, you probably did not type all 195 countries from memory. You installed an npm package (i18n-iso-countries, country-list, world-countries, countries-list), or copied a JSON file from a GitHub gist, or used the list built into your framework, or scraped it from Wikipedia, or used a list your company has had in a database since 2014.
That list is facts.json. It is a structured collection of facts: each country has an ISO 3166-1 alpha-2 code (ZW for Zimbabwe, KE for Kenya, US for United States), an alpha-3 code (ZWE, KEN, USA), a numeric code, a name in English (and potentially in other languages), a flag emoji (sometimes), a dial code (sometimes), a currency code (sometimes), and a continent (sometimes). It is a piece of reference data that almost every web application depends on, and almost no one thinks about until it is wrong.
And it is often wrong: - Many country lists still include "Swaziland" (the country changed its name to Eswatini in 2018). - Some lists include "Netherlands Antilles" (dissolved in 2010) but do not include Curaçao, Sint Maarten, or the Caribbean Netherlands. - Many lists use "Burma" instead of "Myanmar," "Czech Republic" instead of "Czechia" (the short name adopted in 2016), "Macedonia" instead of "North Macedonia" (renamed in 2019), "Turkey" instead of "Türkiye" (official change in 2022). - Lists that include Kosovo, Palestine, Taiwan, Somaliland, and Western Sahara vary depending on the political views of whoever compiled the list. - Dial codes are often wrong or out of date. - Currency codes sometimes list pre-euro currencies for eurozone countries. - Many lists include vague entries like "Congo" without distinguishing Republic of the Congo (CG) from Democratic Republic of the Congo (CD).
These errors are not trivial. A country list that uses the wrong country name causes offense to users. An incorrect currency code causes payment failures. A missing country excludes users from that country entirely from your service. An outdated dial code prevents SMS verification messages from being delivered. The country dropdown is a tiny piece of every application, but when it is wrong, real costs are imposed on real users.
countries.json is just one example. Consider other datasets:
Currency data. Every application that deals with money needs to know what currencies exist, their ISO 4217 codes, their subunits (dollars have cents, but some currencies have no subunits — JPY, KRW), their decimal places, their symbols, which countries use them, and which currencies are pegged to others. Get this wrong and financial calculations break.
Postal code validation. Every country has a different postal code format (US ZIP codes are 5 digits or 5-4; UK postcodes are complex alphanumeric patterns; many African countries do not use postal codes at all). Validating postal codes correctly requires a per-country regex dataset.
Time zones. The IANA Time Zone Database (tzdb, also called zoneinfo) is the canonical reference for every time zone in the world, including historical changes (when countries changed their offset, adopted daylight saving, abolished it, changed their standard time). Every operating system, every programming language's standard library, every calendar application depends on this database. It is maintained by volunteers and updated several times per year as countries change their time rules.
Public holidays. Every country has public holidays, and they change every year (some move with lunar calendars, some are declared ad hoc by governments, some change when a government changes). A calendar or scheduling application needs accurate public holiday data for every country it operates in.
Regulatory codes. Tax codes, medical codes (ICD-10, SNOMED CT, LOINC), industry classification codes (ISIC, NAICS, SIC), country-specific regulatory identifiers (tax ID formats, company number formats, national ID number formats) are all reference datasets that software must get right.
Geographic data. Lists of provinces, districts, cities, postal codes, administrative boundaries, coordinates. These are essential for logistics, delivery, taxation, government services, and location-based features.
Language and locale data. Language names and codes, plural rules, date formats, number formats, currency formatting rules, text direction (LTR/RTL), collation rules (how to sort names alphabetically in different languages). This data powers internationalization in every multilingual application.
These datasets are the "plumbing" of the internet. They are as critical to the functioning of software as DNS, TLS, or HTTP. And yet, unlike DNS or TLS, they are largely ungoverned, inconsistently maintained, frequently wrong, and often locked behind paywalls.
Most reference data files suffer from several structural problems:
They are unmaintained. A developer created countries.json in 2012 and posted it to GitHub. It was copied into npm packages, Ruby gems, Python packages, and thousands of applications. The original developer lost interest in 2015. Eswatini changed its name in 2018 but the file was never updated. Anyone who depends on that file is wrong.
They have no versioning. If you load countries.json from a CDN without pinning a version, it can change underneath you and break your application. If you depend on a package that bundles the data, the data is frozen at the version you installed but never updated (so it drifts out of date). Reference data changes on human timescales (countries rename themselves, new currencies are introduced, governments change holidays); without versioning and update mechanisms, software becomes stale.
They have no validation. Anyone can publish a JSON file. There is no schema, no automated test suite, no CI that checks whether codes are valid ISO codes, whether populations add up, whether geometries are valid, whether dialect codes are correctly mapped. Errors accumulate and are copied from one file to the next as people fork and rehost the data.
They lack provenance. Where did the data come from? Did it come from the UN, from Wikipedia, from a government website, from some guy who typed it up on a weekend? What year was it accurate for? Without provenance metadata, you cannot know whether the data is authoritative.
They are incomplete from a global perspective. Most widely used reference datasets are built from a North American or European perspective. African countries are often treated as afterthoughts — wrong capitals, missing districts, outdated currencies, incorrect mobile operator data, missing languages. I have found three different african-countries.json files that listed South Sudan's capital as Juba correctly but omitted its 10 states entirely; one listed Zimbabwe's currency as ZWD (which was abandoned in 2009 when the country dollarized).
They are paywalled. The ISO sells the official ISO 3166 country code list for 360 Swiss francs. The official ISO 4217 currency codes cost 244 CHF. ICD-10 medical codes require a license from WHO for commercial use in some jurisdictions. Many official administrative boundary datasets are sold by national mapping agencies for hundreds or thousands of dollars. Basic facts about the world — country codes, currency codes, disease classifications — are locked up as if they are proprietary intellectual property.
They are inconsistent. One dataset lists "Côte d'Ivoire" with the accent; another lists "Cote d'Ivoire" without; another lists "Ivory Coast" in English; another lists it under C (for Côte) and another under I (for Ivory). Different files use different code systems, different naming conventions, and different categorizations, making it hard to merge or cross-reference datasets.
These problems are solvable. They are engineering problems, not fundamental problems. The rest of this book describes how to build facts.json properly.
On a Friday in April 2024, the Reserve Bank of Zimbabwe announced a restructuring of Zimbabwe's domestic currency. The Zimbabwean dollar (ZWL), which had been the official local currency since its reintroduction in 2019, was being replaced by a new structured currency, ZiG (Zimbabwe Gold), backed by gold reserves. The change was effective immediately that Monday.
For software developers in Zimbabwe, this announcement created an immediate problem: every financial application in the country hardcoded currency codes, exchange rate logic, and multi-currency handling assumptions around ZWL. Point-of-sale systems, accounting software, banking apps, mobile money integrations, tax filing tools, e-commerce platforms, and payroll systems all had to be updated before Monday morning. The central bank published the new ISO code (ZWG was proposed; final code was being finalized with SWIFT), exchange rate pegging rules, and accounting treatment guidelines in a 42-page PDF released at 4 PM on Friday.
Over that weekend, I updated african-currencies.json (my open currency dataset) to include the new currency, documented the transitional period rules, and published a patch release by Saturday morning. I added provenance citing the RBZ press release, documented the transition period during which both currencies would be legal tender, and included both ZWL and ZWG with their validity dates. Over 40 developers downloaded the update that weekend. Several fintechs used the updated dataset to patch their systems before Monday trading.
This is the value of maintained reference data. Without an open, up-to-date currency dataset, every developer at every fintech in Zimbabwe would have independently deciphered the same 42-page PDF, extracted the same facts, made the same code changes, and likely made the same mistakes (different developers interpreting the transition rules slightly differently). With a maintained dataset, one person did the work once and everyone benefited.
The event cost me about 4 hours of work on a Saturday. That 4 hours saved hundreds of developer-hours across the Zimbabwean fintech ecosystem — and probably prevented bugs that would have affected thousands of users on Monday morning. That is the leverage of facts.json.
The first step in building a good reference data file is to define a clear, typed schema. A schema specifies what fields exist, what types they have, which fields are required, what formats values must follow, and what valid values look like.
For example, a good country entry might look like:
{
"iso_a2": "ZW",
"iso_a3": "ZWE",
"iso_numeric": "716",
"name": {
"common": "Zimbabwe",
"official": "Republic of Zimbabwe"
},
"currencies": ["ZWL", "USD"],
"capital": "Harare",
"region": "Africa",
"subregion": "Eastern Africa",
"languages": ["en", "sn", "nd"],
"phone_code": "+263",
"tld": ".zw",
"population_estimate": 15178979,
"population_year": 2022,
"flag_emoji": "\ud83c\uddff\ud83c\uddfc",
"independent": true,
"un_member": true
}
Every field has a defined type (strings, arrays of strings, integers, booleans, nested objects). Codes (iso_a2, iso_a3, phone_code, currencies) must conform to known standards. A schema validator (using JSON Schema, or TypeScript types, or Python Pydantic models) can automatically check that every entry conforms to the schema.
Without a schema, you get inconsistent entries: some countries have dial_code as an integer, some as a string with a plus sign, some as an array, some missing it. These inconsistencies break code that consumes the data. The schema is a contract: if an entry validates against the schema, code can rely on it.
Every fact in a reference dataset must have a traceable source. Good provenance means:
Example of a fact with provenance:
{
"iso_a2": "ZW",
"currencies": ["ZWL", "USD"],
"_provenance": {
"currencies": {
"source": "Reserve Bank of Zimbabwe press release, 2024-04-05",
"source_url": "https://www.rbz.co.zw/...",
"verified": "2024-04-12"
}
}
}
Provenance metadata takes a little extra work to maintain, but it is essential. It allows consumers of the data to assess trustworthiness, to verify facts independently, and to understand when data might be stale. It also prevents the "telephone game" problem where data is copied from file to file over a decade with no one knowing where it came from.
A reference data file is code, not just data. It should be tested like code.
Every facts.json repository should include:
Schema validation — every entry validated against the JSON Schema (or equivalent) in CI. An entry missing a required field, or with a currency code that is not in ISO 4217, or with a phone code in the wrong format, causes the build to fail.
Cross-field validation — checks beyond the schema: every currency code referenced must exist in the currency dataset; every language code must be a valid ISO 639 code; every country referenced as a neighbour must exist in the dataset; population must be a positive integer; coordinates must be within valid ranges.
Uniqueness checks — no duplicate ISO codes, no duplicate entries, no contradictory data (a country should not have two capitals).
Snapshot tests — the data in a released version should not change accidentally. If a PR changes 300 country names unexpectedly, that is a red flag even if it passes schema validation.
Source link checks — if provenance includes URLs, periodically verify that the URLs still resolve (sources move; governments redesign websites; broken links should be updated).
External cross-validation — periodically compare against another authoritative source (UN data, ISO, national statistics offices) to catch systematic errors.
These tests run in CI (GitHub Actions, GitLab CI) on every commit. If a test fails, the change cannot be merged. This makes the data reliable in the same way good software is reliable: errors are caught automatically rather than discovered by end users.
Reference data changes. Countries rename themselves. Currencies are introduced or withdrawn. Governments change districts. Holidays are declared. A good facts.json repository must have a versioning strategy so consumers can rely on it without surprise breakages.
I use semantic versioning adapted for data: - Major version (1.x → 2.x): Breaking changes. Schema changes (renaming or removing fields, changing field types, restructuring the JSON). Consumers must update their code to use the new format. - Minor version (1.0 → 1.1): Additive changes. New entries, new optional fields, new data that does not break existing consumers. - Patch version (1.0.0 → 1.0.1): Corrections. Fixed typo, corrected a wrong fact, updated a population estimate, fixed a holiday date.
Releases are tagged (e.g. v1.2.0) with changelogs, published as GitHub releases, and distributed via package managers (npm, PyPI, Packagist, RubyGems) and via direct download. Consumers pin to a specific major version and can update at their own pace.
I never change released data silently. If a correction is needed, it goes out as a patch release with a clear changelog entry.
A good dataset must be easy to consume. Distribute in multiple formats:
Distribute through: - GitHub releases (canonical source of truth, versioned). - Package managers (npm, PyPI, etc.) for easy installation by developers. - A public website with documentation, search, changelog, API for programmatic access. - A CDN for direct hotlinking (with versioned URLs so data doesn't change out from under users).
The entire countries.json file is 200 KB. Distributing it is a solved problem; there is no reason these files should not be free, fast, and easy to access.
countries.json is the canonical facts.json file — the dataset that ships with almost every internationalized application. The primary source for country codes is ISO 3166-1, which defines alpha-2, alpha-3, and numeric codes for recognized countries and territories.
Issues with country data that every maintainer must address:
- Political recognition. ISO 3166 follows UN membership and recognition, which means Kosovo, Taiwan, Palestine, Vatican City, and several disputed territories have varying status. Different consumers need different stances on these. Provide multiple distributions (ISO-only, UN-member-only, including disputed territories) rather than forcing one view.
- Name translations. Every country has different names in different languages. Provide name objects with keys for common languages, not just English.
- Name changes. Track historical names and the year of change (e.g. Swaziland → Eswatini, 2018). Some consumers may need to support legacy data that uses old names.
- Dependencies and territories. Include not just sovereign states but also territories and dependencies (Puerto Rico, Hong Kong, Gibraltar, Réunion) — many applications need them. Flag them clearly ("independent": false) so consumers can filter if needed.
- Out-of-date data is everywhere. Most npm country packages have not been updated in 4+ years. Maintainers, update your dependencies. Consumers, pin to actively maintained packages.
Currency data looks simpler than it is. ISO 4217 defines three-letter codes, numeric codes, and subunit information. But real-world currency use is messy: - Multi-currency economies. Zimbabwe uses USD, ZWL (a local electronic currency), and (to a declining extent) South African rand and Botswana pula. This is not captured by a simple "one country, one currency" model. - Pegged currencies. CFA franc (XOF/XAF) is pegged to the euro; some Caribbean currencies are pegged to USD; the Namibian dollar is at par with the South African rand. Cross-currency calculations need this. - Non-decimal currencies. Historically most currencies were non-decimal; today the Malagasy ariary (MGA) and Mauritanian ouguiya (MRU) are technically non-decimal (based on 5 subunits), though in practice they are treated as decimal. The Mauritanian currency's divisor matters for correct rounding. - Cryptocurrencies and private currencies. Bitcoin, Ethereum, and mobile money units (M-Pesa's Kenyan shilling is KES, but some mobile money systems have proprietary units) blur the line between "official" and "practical" currencies. - Withdrawn currencies track their withdrawal dates. Old currencies (ZWD, ZWR, ZWL — Zimbabwe has had multiple local currencies; the French franc before the euro; various Latin American currencies that were redenominated) should remain in historical datasets with dates of withdrawal.
Country-level data is rarely granular enough for real applications. Logistics, electoral systems, health services, school systems, taxation, and delivery all operate at subnational levels: provinces, states, regions, districts, counties, municipalities.
Good subnational data must include: - A stable identifier (an administrative code, not just a name — names change and repeat; codes are stable). - The level (ADM1 = province/state; ADM2 = district/county; ADM3 = municipality/ward). - Parent relationship (each district belongs to a province). - Type (province, region, state, county, district, department, municipality — terminology varies). - Coordinates (centroid, at minimum) and optionally polygon boundaries. - Population (with year and source). - Capital/headquarters for subnational units.
For Africa this data is particularly patchy. GADM (gadm.org) provides administrative boundaries but has errors in several African countries, is licensed non-commercially (problematic for commercial software), and does not always reflect recent redistricting. OpenStreetMap often has more accurate data but is inconsistent across regions. Government websites are the authoritative source but are hard to find, sometimes require scraping, and are frequently reorganized without notice.
Maintaining zw-districts.json for Zimbabwe requires tracking:
- 10 provinces (provinces are stable but occasionally reorganized).
- 64 districts (redistricted most recently in 2007; some new districts have been created since and boundaries shift).
- 1,958 wards (changed most recently during 2023 delimitation).
- Coordinates, populations, and administrative codes for each.
Every redistricting exercise requires updating the data and issuing a new release.
The gap in quality reference data for Africa is real and problematic. Every African fintech, edtech, healthtech, agritech, e-commerce, and government technology project needs the same datasets — countries, currencies, subdivisions, mobile operators, schools, health facilities, tax codes, postal codes, languages — and every company builds them independently from scratch, duplicating work and making the same mistakes.
Examples of the gap: - There is no open, maintained, authoritative dataset of all registered schools in any African country I am aware of (ministries of education publish PDF lists or partial spreadsheets, but no structured, versioned, validated data). - Health facility lists are maintained by WHO (HEAT) and other initiatives but are 2–3 years out of date in most countries, and many facilities open and close without being recorded. - Mobile operator data (MNC codes, USSD shortcodes, mobile money integrations) changes constantly as operators launch new services, merge, and change pricing; no open dataset tracks this systematically. - Postal code systems exist in only about half of African countries, and the formats are not well-documented anywhere open. - Tax registration number formats and validation rules vary by country and change as tax authorities update systems; there is no open reference.
This gap is an opportunity and a responsibility. African developers building African software cannot rely on datasets maintained by developers in Berlin or San Francisco who do not know the difference between Manicaland and Mashonaland East. We need to build these datasets ourselves, collaboratively, as open public infrastructure.
I started zw-districts.json in 2021 out of frustration. I was building the school product for my studio and needed a structured list of Zimbabwe's provinces and districts to populate administrative dropdowns. The existing options were all bad:
- Wikipedia's list of districts was 3 years out of date and had several errors.
- The government's ZIMSTAT website published a PDF of district boundaries that was hard to extract data from.
- GADM had boundaries but the district list was inconsistent with official 2023 delimitation.
- A GitHub gist I found had 59 districts listed (Zimbabwe has had 64 districts since 2007) and misspelled several names.
I spent three evenings cross-referencing sources: the 2012 Census provincial/district reports from ZIMSTAT, the Electoral (Zimbabwe) (Delimitation) Notice 2023, the Postal and Telecommunications Regulatory Authority district list, and provincial maps. I built a JSON file with: - 10 provinces (Bulawayo, Harare, Manicaland, Mashonaland Central, Mashonaland East, Mashonaland West, Masvingo, Matabeleland North, Matabeleland South, Midlands). - 64 districts (each mapped to its parent province, with administrative codes per ZIMSTAT). - Centroid coordinates for each district (from OpenStreetMap, verified visually). - 2012 census population figures with source. - Province capitals.
I published the first version on GitHub under CC BY, wrote a README documenting sources, and set up JSON Schema validation in GitHub Actions (running on every push). I announced it in a Zimbabwean developers WhatsApp group.
Over the past five years: - 18 developers have submitted pull requests (correcting typos, adding updated population estimates, correcting coordinate errors). - Two fintech companies have sponsored maintenance ($200/month each) to keep the data updated and add ward-level data. - The dataset is used by at least 30 Zimbabwean software products I know of, including three banks, two e-commerce platforms, a national exam registration system, and my own school and pharmacy products. - I have issued 12 releases (major version 1; 12 minor/patch updates), most recently in November 2026 adding 2022 census preliminary data. - Total time invested: approximately 120 hours over five years (initial build 18 hours; ongoing maintenance 2 hours per month; PR review and release work).
This is the model for how facts.json should work: one maintainer (or a small team), open license, validated schema, versioned releases, sponsored by commercial users who depend on it, improved by community contributions. The data is now more accurate than any single source — because it has been used in production by dozens of companies and the errors have been found and fixed.
The IANA Time Zone Database (tzdb, sometimes called zoneinfo or the Olson database) is the gold standard for how reference data infrastructure should be maintained. It is worth studying as a model.
tzdb contains code and data representing the world's time zones, including historical changes (when countries changed their offset, adopted or abolished daylight saving time, changed standard time, split a time zone). It is maintained by a small group of volunteers (historically Arthur David Olson, later Paul Eggert and a team of contributors), hosted on IANA's servers, and distributed as a public domain database.
Key features of tzdb that make it exemplary: - Open, public domain. The data is free for any use. - Versioned. Releases happen several times per year as countries announce time changes. Each release is clearly versioned (e.g. 2024a, 2024b). - Sourced. Every entry has a source (government notices, news reports, official gazettes). The mailing list discusses proposed changes and sources. - Backwards-compatible. The format is stable; changes are additive and corrections. - Critical infrastructure. Every Linux, macOS, and BSD system ships tzdb data. Most programming languages use it. It is embedded in iOS and Android. It is one of the most widely depended-upon datasets in the world. - Volunteer-maintained but institutionally supported. ICANN and other organizations provide funding. The maintainers are respected professionals who do this work as a public service.
The lesson: a small team of dedicated maintainers, with institutional support and an open process, can maintain infrastructure that the entire world depends on. Facts.json datasets should aspire to the tzdb model.
Public holiday data is a surprisingly hard problem. Holidays: - Change every year. - Depend on lunar calendars (Easter, Eid al-Fitr, Eid al-Adha, Diwali, Chinese New Year) with dates determined by religious authorities. - Are sometimes declared at the last minute (governments announce ad hoc holidays for events, funerals, elections, or weather). - Vary by subnational region (states/provinces have different holidays). - Have substitution rules (if a holiday falls on a weekend, is the preceding Friday or following Monday a public holiday? Different countries handle this differently). - Have changed dramatically during the COVID-19 pandemic (many countries declared special holidays or suspended others).
Several open holiday datasets exist (holidays Python package, date-holidays npm package), but coverage of African countries is poor (most have incomplete or inaccurate data) and no single dataset is authoritative. The result is that every calendar application, every payroll system, every logistics company builds and maintains its own holiday data — a massive duplication of effort.
A properly maintained open global holiday database, with country and subnational coverage, historical data going back decades, forward data for the coming year, source citations, and multiple language support, is one of the most obvious missing facts.json infrastructures. It would save the software industry collectively tens of millions of dollars per year in duplicated effort.
There are roughly 700,000 primary and secondary schools across Africa. Every ministry of education maintains a registry of schools (for funding allocations, exam administration, teacher postings, inspection). Almost no country publishes this registry as open, structured, machine-readable data.
What exists instead: - PDF lists (sometimes scanned from printed documents, sometimes generated digitally). - Spreadsheets published irregularly (often only available via formal request or in annual reports). - Data embedded in annual statistical reports (locked in PDF tables). - Partial lists on government websites (inconsistent, rarely updated). - Lists compiled by NGOs for specific programmes (not comprehensive).
The consequence: every edtech company, every NGO education programme, every examination body, every donor-funded education project, and every researcher independently compiles school lists from whatever sources they can find. These lists are inconsistent, out of date, full of duplicates, missing new schools, including closed schools, and incompatible with each other.
Building an open, maintained school registry per country is not technically difficult. The data exists in government files. It requires: - Obtaining the official list (via freedom of information requests, partnerships with ministries, or digitizing published documents). - Adding unique identifiers (the EMIS code, where one exists). - Adding GPS coordinates (many schools already have them from past surveys; others can be geocoded from addresses). - Versioning and updating annually. - Validating against other sources (exam registration data, census data, donor program data).
The Zimbabwean school registry I maintain (as part of my studio's work) has 9,782 schools. It took six weeks to compile from ZIMSEC exam registration lists and Ministry of Education data, and it is maintained with annual updates. It is used by my own school product and by three other edtech companies in Zimbabwe. If someone did this for 54 African countries (a big project but achievable with distributed, collaborative effort), it would be transformative for African education technology.
I have maintained zw-districts.json and related African datasets for five years. The work is not glamorous but it is consistent:
The total time cost of maintaining one dataset is 2–4 hours per month. That is small enough to sustain voluntarily but large enough that most developers will not do it (especially for a dataset they do not directly earn money from). The work scales because it is a shared resource — 2 hours of my time per month produces data that hundreds of developers and companies use.
There are several models for sustaining open reference data work:
The right model depends on the dataset. For small, country-specific datasets, a single volunteer maintainer with corporate sponsorship is often the most practical model. For large global datasets (country codes, currency codes, timezone data), institutional or foundation sponsorship with professional maintainers is more appropriate.
Facts themselves are not copyrightable in most jurisdictions (you cannot copyright the fact that Zimbabwe's capital is Harare). But a particular compilation, arrangement, or database structure can have copyright (the "sweat of the brow" doctrine in some countries; the EU Database Directive protects substantial investment in obtaining, verifying, or presenting database contents in EU countries).
For public reference data, I recommend: - CC0 (public domain dedication) for pure factual data — no restrictions on use, no attribution required, suitable for maximum adoption. Use this if you want the data to be used as widely as possible with zero friction. - CC BY (attribution) if you want credit but no other restrictions. This ensures the data remains open while giving maintainers credit (useful for building reputation and justifying continued maintenance). - CC BY-SA (attribution-sharealike) if you want derivatives to remain open (similar to the GPL). This prevents commercial entities from taking the data, improving it, and locking the improvements behind paywalls.
I release my own reference datasets under CC BY. The data is free for any use, including commercial use; I ask only for attribution (and appreciate improvements submitted back as pull requests, though this is not required).
I strongly advise against: - Non-commercial (NC) licenses for reference data. This makes the data unusable for commercial software — which is where most reference data is actually needed. - No-derivatives (ND) licenses. These prevent people from correcting errors or adapting the data to their needs, which defeats the purpose. - Paywalls for raw reference data. Locking public facts (country codes, currency codes, postal code formats) behind paywalls is extractive rent-seeking on non-rivalrous public goods. ISO's paywall for official code lists is an example of this; the standards body funds its operations partly by selling data that was created by national delegations and should be public.
If you consume reference data files (and every application does), here is how to do it responsibly:
countries.json from a URL that can change underneath you. Pin to a specific versioned release and update deliberately when you are ready.If you publish reference data (as I do for African datasets), make it easy to consume:
/v1/countries.json) and commit to not changing the response format within a major version.last_updated and version field in the data itself.Good open reference data creates a positive feedback loop: 1. Someone publishes accurate, maintained data under an open license. 2. Developers start using it because it is better than what they had before. 3. Those developers find errors (because they are using the data in production, at scale, in ways the maintainer did not anticipate) and contribute corrections. 4. The data becomes more accurate. 5. More developers adopt it. 6. Commercial users sponsor maintenance because they depend on it. 7. The data becomes the de facto standard, making it better for everyone.
This is how IANA time zone database works, how OpenStreetMap works, how open-source programming languages work, and how good public reference data can work. It requires: good initial quality, a permissive license, active maintenance, and low friction for contribution. The alternative — every company maintaining its own private copy of the same reference data — is redundant, expensive, and produces worse data (because errors in private copies never get corrected by anyone outside the company).
A JSON Schema is the contract for your data. Here is a minimal example schema for a country entry:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/schemas/country.schema.json",
"title": "Country",
"type": "object",
"required": [
"iso_a2", "iso_a3", "name",
"currencies", "capital", "region"
],
"properties": {
"iso_a2": {
"type": "string",
"pattern": "^[A-Z]{2}$",
"description": "ISO 3166-1 alpha-2 code"
},
"iso_a3": {
"type": "string",
"pattern": "^[A-Z]{3}$",
"description": "ISO 3166-1 alpha-3 code"
},
"name": {
"type": "object",
"required": ["common", "official"],
"properties": {
"common": { "type": "string", "minLength": 2 },
"official": { "type": "string", "minLength": 2 }
}
},
"currencies": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[A-Z]{3}$"
},
"minItems": 1
},
"capital": { "type": "string", "minLength": 2 },
"region": {
"type": "string",
"enum": ["Africa", "Americas", "Asia", "Europe",
"Oceania", "Antarctic"]
},
"population_estimate": {
"type": "integer",
"minimum": 0
},
"independent": { "type": "boolean" },
"un_member": { "type": "boolean" }
},
"additionalProperties": false
}
A schema like this can be validated in CI using tools like ajv-cli (JavaScript), jsonschema (Python), or directly in many languages. Every pull request must pass schema validation before merging.
A minimal CI validation pipeline (using GitHub Actions) for a facts.json repository looks like this:
```yaml
name: Validate Data on: [pull_request, push] jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.12' - run: pip install jsonschema - name: Validate all entries against schema run: python scripts/validate.py - name: Validate against ISO standards run: python scripts/validate_iso.py - name: Check for duplicates run: python scripts/check_duplicates.py - name: Check provenance completeness run: python scripts/check_provenance.py ```
Each validation script is straightforward Python:
```python
import json, jsonschema, pathlib
schema = json.loads(open('schema/country.schema.json').read()) data = json.loads(open('data/countries.json').read())
validator = jsonschema.Draft202012Validator(schema) errors = list(validator.iter_errors(data)) if errors: for e in errors: print(f"Error at {list(e.path)}: {e.message}") exit(1) print(f"Validated {len(data)} countries: OK")
Additional validation scripts check cross-field consistency (currency codes must exist in `currencies.json`, language codes must be valid ISO 639, etc.), uniqueness (no duplicate codes), and provenance completeness (required fields have sources).
## Chapter 29 · Structuring the repository
A clean repository structure makes a dataset easy to maintain and consume:
facts-countries/ ├── README.md # documentation, usage, license ├── CHANGELOG.md # per-release changelog ├── LICENSE # CC0 or CC BY ├── schema/ │ └── country.schema.json ├── data/ │ ├── countries.json # primary data file │ ├── countries.csv # CSV distribution │ └── countries.ndjson # NDJSON distribution ├── scripts/ │ ├── validate.py # schema validation │ ├── validate_iso.py # external validation │ ├── build_dist.py # build CSV/NDJSON from JSON │ └── check_provenance.py ├── tests/ # snapshot tests └── .github/workflows/ └── validate.yml # CI pipeline
Released versions are tagged (e.g. `v1.3.0`) and uploaded as GitHub Releases, with all distribution formats (JSON, CSV, NDJSON) attached. A simple GitHub Pages site can provide documentation and an API endpoint.
## Chapter 30 · Publishing to package managers
To make the data as easy to consume as possible, publish it to popular package managers:
- **npm:** a `countries-data-africa` package that loads the JSON and exports it as a JavaScript module.
- **PyPI:** a Python package providing the data as a Python dict/object.
- **Packagist (PHP), RubyGems (Ruby), NuGet (.NET)** for other ecosystems as needed.
Each package is a thin wrapper that loads the JSON file and provides helper functions (e.g. `getByIsoA2('ZW')`). The data itself remains the canonical source; packages are updated with each release.
## Chapter 31 · Serving data via API
For applications that want to fetch data on demand rather than bundle it, provide a versioned JSON API:
GET /v1/countries.json → all countries GET /v1/countries/ZW.json → one country GET /v1/currencies.json → all currencies GET /v1/subdivisions/ZW.json → subdivisions for one country ```
The API should: - Be versioned in the URL. - Set long cache headers (versioned data does not change; cache for 30+ days). - Serve from a CDN for global low-latency access. - Rate-limit only minimally (the data is public). - Always include the version number in the response.
This API does not replace distributing the raw files; it complements them. Many applications prefer to bundle the data; others prefer to fetch it at runtime. Both should be supported.
There are reference datasets that should exist as open, maintained, high-quality public infrastructure but do not. A partial list:
Building these datasets is not technically difficult. It requires research, validation, and ongoing maintenance. Every one of these datasets would be worth tens of millions of dollars in aggregate efficiency to the software industry if it existed as open infrastructure. Most of the source data exists in government files, UN databases, and institutional reports — it just needs to be structured, validated, versioned, and maintained.
Basic factual data about the world — country codes, currency codes, administrative boundaries, public facility locations, tax formats, language codes — is a commons: a shared resource that benefits everyone and that no one can be excluded from using. Like DNS, like open-source software, like the internet protocols themselves, reference data is infrastructure that works best when it is open, maintained collaboratively, and not locked behind paywalls or proprietary restrictions.
The internet was built on open protocols and open standards. Open-source software powers almost every server and every phone on earth. Wikipedia proved that collaborative open knowledge works at scale. OpenStreetMap proved that collaborative mapping can rival commercial maps. The next layer of infrastructure — structured, validated, versioned reference data — is one of the remaining gaps.
For African developers, building these datasets is not charity work. It is prerequisite infrastructure for the software we are building. We cannot build reliable fintech without reliable currency and mobile operator data. We cannot build healthtech without reliable health facility data. We cannot build edtech without reliable school data. We cannot build e-government without administrative boundary data and tax ID validation. We can wait for someone in Europe or America to build it for us (and wait forever, because they will not understand our contexts and will get it wrong), or we can build it ourselves.
Building facts.json is not glamorous. It will not get you on the cover of TechCrunch. It will not raise you venture capital. But it is infrastructure, and infrastructure is what everything else is built on top of. If we build it well, thousands of developers and millions of users will benefit from it for decades, in ways we will never directly see. That is the definition of good infrastructure: invisible when it works, essential always.
If you are a developer who uses reference data, you can contribute today: - Find a dataset you use that is incomplete or out of date. - Correct one entry. - Submit a pull request. - If the dataset is unmaintained, fork it and start maintaining your version (publish it under an open license). - If a dataset you need does not exist, start it. Begin with your country, your city, the problem you are working on. Publish version 0.1 with 20 entries and a schema. It will grow from there.
Start small. A 50-line JSON file of your country's provinces, validated, with sources and a changelog, is more useful than a grand plan for a universal knowledge graph that never ships. Publish it. Tell other developers. Maintain it. The infrastructure builds one fact at a time.
I keep coming back to the idea that every software application rests on facts. The facts are not glamorous. They are not "AI." They are not "real-time." They are lists of countries, currencies, districts, schools, hospitals, postcodes, tax codes, time zones, holidays. They are boring, and they are everywhere.
When the facts are wrong, the software that depends on them is wrong. A payment fails because the currency code is wrong. A drug prescription is rejected because the medical code is outdated. A school cannot be registered because its district is not in the list. A delivery goes to the wrong province because the district data is wrong. A user cannot sign up because their country is missing from the dropdown. These are small failures individually; collectively they are a tax on every application built in contexts where the reference data is bad.
Building good facts.json is the most boring kind of software engineering. It is also one of the most valuable kinds. Get the facts right, make them public, maintain them, and everything built on top gets a little bit better. Get them wrong or lock them behind paywalls, and the entire stack suffers.
If you build nothing else, build the facts.json that your part of the world needs. Publish it. Maintain it. Put it in the public commons. Someone, somewhere, is trying to build something that needs it.
Take an application you work on. Find every place that uses reference data (country dropdown, currency formatting, timezone handling, address validation, phone number formatting, language settings). Trace where that data comes from. Is it hardcoded? From a library? From a third-party API? When was the source last updated? Are there known errors?
Document what you find. If the data is out of date, update it or switch to a better-maintained source. This exercise alone will likely surface bugs you did not know you had.
Pick a small reference dataset relevant to your work (currencies, provinces of your country, phone carriers, public holidays, tax types). Write a JSON Schema for it with required fields, types, formats, and value constraints. Write a validator. Create a sample data file with 10 entries that validates against the schema. Publish it to GitHub. You have started a facts.json project.
Find a public reference dataset (on GitHub, on npm, anywhere open). Identify at least one error (wrong name, outdated code, missing entry, incorrect format). Submit a pull request or open an issue with the correction and a source citation. You have contributed to public infrastructure.
For any reference data you maintain (even an internal company list), add provenance metadata: source URL, date verified, who verified it. Add a CHANGELOG. Version the first release as 1.0.0. This makes your data auditable and trustworthy.
If you maintain any reference data that is not proprietary or sensitive, publish it under CC0 or CC BY on GitHub with a README, a schema, and validation tests. Announce it in a relevant developer community. Other developers will find it, use it, and contribute corrections.
A curated list of reference datasets (as of 2026) that I have found reliable:
Countries and territories
- ISO 3166 (official, paywalled): iso.org
- REST Countries API (free, open): restcountries.com
- world-countries npm package (actively maintained, open source)
- UN Statistical Division M49 (standard country and region codes): unstats.un.org
Currencies
- ISO 4217 (official, paywalled): iso.org
- currency-codes npm package (maintained)
- SWIFT reference data (for banking)
Time zones - IANA Time Zone Database (canonical, free): iana.org/time-zones - moment-timezone (JavaScript implementation with data)
Languages - ISO 639 (language codes) - CLDR (Unicode Common Locale Data Repository): cldr.unicode.org — comprehensive locale data for internationalization
Geography/administrative boundaries - OpenStreetMap (osm.org) — open, crowd-sourced - GADM (gadm.org) — administrative boundaries (non-commercial license) - GeoNames (geonames.org) — geographic names database - Natural Earth (naturalearthdata.com) — public domain map data at various scales
African data - Africa Open Data (africaopendata.org) — various datasets - AfDB Open Data Portal (afdb.org) — African Development Bank data - Humanitarian Data Exchange (data.humdata.org) — UN OCHA humanitarian datasets including facilities and administrative boundaries - Individual national statistics agencies (ZIMSTAT, Stats SA, KNBS, etc.)
Public holidays
- holidays Python package (open source, extensive coverage)
- date-holidays npm package
CI (Continuous Integration) — Automated build and testing process that runs on every code commit.
CC BY — Creative Commons Attribution license: content can be used freely with attribution.
CC0 — Creative Commons public domain dedication: no rights reserved, can be used freely for any purpose without attribution.
CSV — Comma-Separated Values, a simple tabular data format.
Facts.json — The term used in this book for structured, versioned reference data files in JSON or similar formats.
ISO — International Organization for Standardization, which publishes many of the official standard code lists (country codes, currency codes, language codes, etc.).
JSON Schema — A vocabulary for annotating and validating JSON documents against a declared schema.
NDJSON — Newline-delimited JSON, one JSON object per line, suitable for streaming processing.
Open data — Data that can be freely used, modified, and shared by anyone for any purpose.
Provenance — The origin and history of a piece of data: where it came from, when it was verified, who collected it.
Schema — A formal definition of the structure, types, and constraints for data.
Semantic versioning (SemVer) — Version numbering convention (MAJOR.MINOR.PATCH) that signals the nature of changes.
Subnational data — Geographic or administrative data below the country level (provinces, states, districts, municipalities).
This book is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
You are free to: - Share — copy and redistribute the material in any medium or format. - Adapt — remix, transform, and build upon the material for any purpose, even commercially.
Under the following terms: - Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. - No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
Full license text: creativecommons.org/licenses/by/4.0/legalcode
This book is published under CC BY 4.0. It was written in Markdown, assembled with Python, typeset with WeasyPrint, and released as PDF (A5 format, 5.83 × 8.27 inches) and EPUB.
The cover design employs a catalog-card motif — a cream index card with teal and oxblood geometric classification tabs at the top, navy typewritten fields reading "FACTS / JSON / INFRASTRUCTURE / v1.0 / CC BY", evoking library catalog systems and data classification — distinct from all previous books in the series.
Approximately 13,000 words.
Harare, Zimbabwe November 2026