Localization of Extended Date Time Format level 0 strings.
Project description
A Python module for localization of Extended Date Time Format (EDTF) level 0 strings.
EDTF is a syntax for specifying imprecise dates. See http://www.loc.gov/standards/datetime/. This modules relies on python-edtf for EDTF parsing.
Install
Babel-EDTF is on PyPI so all you need is:
$ pip install babel-edtf
Quickstart
Let’s format some EDTF strings:
>>> from babel_edtf import format_edtf >>> format_edtf('2020-01', locale='en') 'Jan 2020'
>>> format_edtf('2020-01/2020-09', locale='da') 'jan.–sep. 2020'
>>> format_edtf('2020-01/2020-09', format='long', locale='en') 'January\u2009–\u2009September 2020'
The following formats are supported:
short
medium
long
full
Changes
Version 1.1.4 (released 2024-03-05)
fix: fail parsing 29th of February on leap years
Version 1.1.3 (released 2023-11-01)
global: use custom parse_edtf in parse_edtf_level0
Version 1.1.2 (released 2023-10-19)
add leading zeros for precise month and day
Version 1.1.1 (released 2023-10-19)
convert isoparse values to string
Version 1.1.0 (released 2023-10-19)
Add parse_edtf isoparse backed method
Version 1.0.0 (released 2020-11-06)
Initial public release.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for babel_edtf-1.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93c80d6b5c227f6da5a5b8ae8b8a2f18a60706b18a0dbd00f28a609437db3295 |
|
MD5 | 806bce54859782f4baab94c3d18043ec |
|
BLAKE2b-256 | b51e3ce8c64c26de8a48662c613529c9bed96b7566c95481d0c418a9d57a8fe9 |