Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-edtf

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-edtf

Localization of Extended Date Time Format level 0 strings.

  • 1.2.1
  • PyPI
  • Socket score

Maintainers
1

.. Copyright (C) 2020 CERN.

Babel-EDTF is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.

============ Babel-EDTF

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 <https://pypi.org/project/edtf/>_ for EDTF parsing.

Install

Babel-EDTF is on PyPI so all you need is:

.. code-block:: console

$ 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

.. Copyright (C) 2020-2024 CERN.

Babel-EDTF is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.

Changes

Version 1.2.1 (released 2024-11-07)

  • fix: consider DD_MM_YYYY invalid

Version 1.2.0 (released 2024-10-28)

  • setup: upgrade edtf to 5.0.0 and fix bug with dates and times with hour 23

Version 1.1.4 (released 2024-03-05)

  • fix: fail parsing 29th of February on non-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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc