Skip to content

v3.3.0

Choose a tag to compare

@dasmig dasmig released this 01 Nov 15:57
· 6 commits to master since this release
b8c3154

Locales, time zones, currencies and public holidays for every country, in seven new tables next to countries.tsv.

  • Locales: get_locale(request[, seed]) draws a locale tag (en-CA, fr-CA) by speakers. find_locale and locales(country) look them up. Each locale carries Unicode CLDR's date, time, number and currency formats, names, first day of the week and measurement system. format_date, format_time, format_number and format_money use those formats. Lite has 499 locales and full has 570; locales with CLDR's root placeholder names are left out.
  • Time zones: get_time_zone(request[, seed]) draws a country's IANA zones by population. find_time_zone follows the backward links (Asia/Calcutta is Asia/Kolkata), and time_zones(country) lists them. Converting between UTC and local time follows tzdata 2026f and gives the same result on every platform.
  • Public holidays: holidays(request), is_holiday and holiday_years. They cover the years 1970 to 2050 that python-holidays covers, with names in the country's language and in English, and the days a weekend moves a holiday to. The rules were inferred from python-holidays and checked against it for every country and year.
  • Currencies: currency_digits(code) gives the ISO 4217 minor unit, for core::money.
  • Batch forms for the drawing getters (get_locale_batch, for_each_locale, get_time_zone_batch, for_each_time_zone), layers on the new tables, and has_locale_data().
  • DASMIG_COUNTRY_EMBED_LOCALE compiles in the lite locale tables (about 1.9 MB of source), separately from DASMIG_COUNTRY_EMBED.

Nothing that already existed changes: get_country's draws, its JSON and the data hash are the same as in 3.2.2, so no consumer's known answers change. Loading the lite tier now also reads the locale tables (about 37 ms). The gate baseline is 540.8M instructions, up from 73.3M: about 410M of that is the load and about 57M is the new getters.

Requires dasmig-core 1.4.0 (time-zone rules, patterns and money).

Data: Unicode CLDR 47 (Unicode License v3), ISO 4217, IANA tzdata 2026f (public domain), GeoNames cities1000 for zone population shares (CC BY 4.0), and python-holidays 0.107 (MIT); see LICENSE_DATA.txt.