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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file babel_edtf-1.2.2.tar.gz.
File metadata
- Download URL: babel_edtf-1.2.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
383d12703cafc1684727e317f25b9cbf1436090a2830232a26e6edf4e361227e
|
|
| MD5 |
b72a394c2739ad1d1e5bc1c36928c19e
|
|
| BLAKE2b-256 |
fe27bda221fdb1fc784fce29df636efa2fd6eb94474af4131a2bc2c4f18aace6
|
File details
Details for the file babel_edtf-1.2.2-py2.py3-none-any.whl.
File metadata
- Download URL: babel_edtf-1.2.2-py2.py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e921c85a208858303a75d0aaccf8d74d882001a16931ce2f63422139db4cd1d9
|
|
| MD5 |
08e8e0479c0683ead50bcf1d390856ae
|
|
| BLAKE2b-256 |
ab71e7ec06e2c6ccf1ee031e1c48d06e29b3d9228568486f8b84590173102867
|