Skip to main content

django-cldr

A Django application for importing and managing Unicode CLDR (Common Locale Data Repository) data.

Provides models for territories, languages, scripts, currencies, subdivisions, and their localized names, plus number and date/time formatting patterns across hundreds of locales.

Features

  • Territories: ISO 3166-1 countries and UN M.49 regions with GDP, literacy, and population data
  • Languages & Scripts: BCP47 language codes and ISO 15924 script codes with usage data
  • Currencies: ISO 4217 currency codes with formatting rules and historical territory usage
  • Subdivisions: Administrative subdivisions (states, provinces, etc.)
  • Localized Names: Translated names for territories, languages, scripts, currencies, and subdivisions across 700+ locales
  • Number Formatting: Locale-specific number symbols and patterns (decimal, percent, currency, scientific)
  • Date/Time Formatting: Locale-specific date, time, and datetime patterns with localized month, day, and timezone names
  • Supplemental Data: Week preferences, measurement systems, numbering systems, calendar preferences, plural rules, and more

Requirements

  • Python 3.10+
  • Django 4.2+
  • PostgreSQL (recommended)

Installation

pip install django-cldr

Add to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'cldr',
]

Run migrations:

python manage.py migrate cldr

Quick Start

Import CLDR data:

# Import core data (territories, languages, currencies, etc.)
python manage.py cldr_import --import=core

# Import localized names
python manage.py cldr_import --import=names

# Import number formatting data
python manage.py cldr_import --import=numbers

# Import date/time formatting data
python manage.py cldr_import --import=dates

# Import subdivisions
python manage.py cldr_import --import=subdivisions

# Import everything
python manage.py cldr_import --import=all

Configuration

Optional settings in settings.py:

# CLDR version to download (default: 46.0.0)
CLDR_VERSION = '46.0.0'

# Locales to import for localized data
# Use a list of locale codes, or "modern" for ~80 most-used locales
CLDR_LOCALES = ['en']  # default

# Cache directory for downloaded CLDR JSON files
CLDR_DATA_DIR = '/path/to/cldr/data'

Usage Examples

from cldr.models import Territory, Language, Currency, LocalizedName

# Get a territory
usa = Territory.objects.get(code='US')

# Get languages spoken in a territory
from cldr.models import LanguageTerritory
languages = LanguageTerritory.objects.filter(territory=usa)

# Get localized territory name
localized = LocalizedName.objects.get(
    territory__code='JP',
    locale='fr',
)
print(localized.name)  # "Japon"

# Get number formatting symbols for a locale
from cldr.models import NumberSymbols
symbols = NumberSymbols.objects.get(locale='de')
print(symbols.decimal)  # ","
print(symbols.group)    # "."

# Get currency display names
from cldr.models import CurrencyDisplayName
names = CurrencyDisplayName.objects.filter(
    currency__code='EUR',
    locale='en',
)

Models

Core Supplemental Data

  • Territory - Countries and regions with metadata
  • Language - BCP47 language codes
  • Script - ISO 15924 writing system codes
  • Currency - ISO 4217 currency codes
  • LanguageTerritory - Languages spoken per territory
  • TerritoryCurrency - Historical currency usage per territory
  • TerritoryContainment - Parent-child territory relationships
  • CodeMapping - Maps between alpha-2, alpha-3, numeric, and FIPS codes
  • WeekData - Week preferences per territory
  • MeasurementSystem - Measurement and paper size preferences
  • NumberingSystem - Numbering systems (Latin, Arabic-Indic, etc.)
  • LikelySubtag - Locale inference rules
  • PluralRule - Cardinal and ordinal plural rules
  • CalendarPreference - Preferred calendar types

Subdivisions

  • Subdivision - Administrative subdivisions

Localized Data

  • LocalizedName - Translated names across locales
  • NumberSymbols - Number formatting symbols per locale
  • NumberPattern - Number formatting patterns (ICU syntax)
  • CurrencyDisplayName - Localized currency names with plural forms
  • DateTimePattern - Date/time formatting patterns per locale
  • MonthName - Localized month names
  • DayName - Localized day-of-week names
  • TimezoneName - Localized timezone display names

Data Source

Data is sourced from the Unicode CLDR project via npm packages published by the Unicode Consortium. The CLDR data is licensed under the Unicode License.

Disclaimer

This project is not affiliated with, endorsed by, or associated with the Unicode Consortium or the CLDR project. It is an independent, third-party Django integration that consumes publicly available CLDR data.

License

MIT License - see LICENSE for details.

Metadata

Release files for django-cldr 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-cldr 0.1.0
File Size Uploaded
django_cldr-0.1.0.tar.gz 20.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-cldr 0.1.0
File Interpreter ABI Platform
django_cldr-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.4 kB

Release files / django_cldr-0.1.0.tar.gz

Download URL django_cldr-0.1.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
dcbc96512f96ff7a803a327dfd7586246a2d012d09e77983f84ac09ec4533572
BLAKE2b-256 checksum
How to use checksums
996ed405e3233c9cf751e16bc0df616d7737444fab802492124962c94c2cd208
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.

Transparency log

Release files / django_cldr-0.1.0-py3-none-any.whl

Download URL django_cldr-0.1.0-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7b604a5459855c9584286dedfde2c78e46281f55752c0a42e8eeb45fe0af15b
BLAKE2b-256 checksum
How to use checksums
a2be277488f10e9bbff9ad84c96324c11aa7235095b9809147aa63e2ef83650b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page