Skip to main content

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

babel_edtf-1.2.2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

babel_edtf-1.2.2-py2.py3-none-any.whl (5.7 kB view details)

Uploaded Python 2Python 3

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

Hashes for babel_edtf-1.2.2.tar.gz
Algorithm Hash digest
SHA256 383d12703cafc1684727e317f25b9cbf1436090a2830232a26e6edf4e361227e
MD5 b72a394c2739ad1d1e5bc1c36928c19e
BLAKE2b-256 fe27bda221fdb1fc784fce29df636efa2fd6eb94474af4131a2bc2c4f18aace6

See more details on using hashes here.

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

Hashes for babel_edtf-1.2.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e921c85a208858303a75d0aaccf8d74d882001a16931ce2f63422139db4cd1d9
MD5 08e8e0479c0683ead50bcf1d390856ae
BLAKE2b-256 ab71e7ec06e2c6ccf1ee031e1c48d06e29b3d9228568486f8b84590173102867

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 files

1.2.1

2 files

1.2.0

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 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