Babel: Internationalization Utilities for Python
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
- breaking Babel 2.15.0 dropped support for Python 3.7, requiring Python 3.8 or newer.
- deprecated The 'format_datetime' function is deprecated and will be removed in a future release.
Install
-
pip install babel
Imports
- format_date
from babel.dates import format_date
Quickstart
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