Babel: Internationalization Utilities for Python

2.18.0 · active · verified Sat Mar 28

Babel is a collection of tools for internationalizing Python applications, with an emphasis on web-based applications. The current version is 2.18.0, released on February 26, 2026. Babel follows an annual release cadence, with major updates typically occurring once a year.

Warnings

Install

Imports

Quickstart

This example demonstrates how to set a locale and format a date accordingly using Babel.

from babel import Locale

# Set the locale to French
locale = Locale('fr', 'FR')

# Format a date in the French locale
from babel.dates import format_date
from datetime import datetime

date = datetime(2026, 3, 28)
formatted_date = format_date(date, locale=locale)
print(formatted_date)  # Output: 28 mars 2026

view raw JSON →