..
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.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.
Raw data
{
"_id": null,
"home_page": "https://github.com/inveniosoftware/babel-edtf",
"name": "babel-edtf",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "babel l10n edtf",
"author": "CERN",
"author_email": "info@inveniosoftware.org",
"download_url": "https://files.pythonhosted.org/packages/82/12/0eef3e6b4dfb49b0a759215cba22a188c0459158624aa12f9d47a9ccb3ef/babel-edtf-1.2.0.tar.gz",
"platform": "any",
"description": "..\n Copyright (C) 2020 CERN.\n\n Babel-EDTF is free software; you can redistribute it and/or modify it\n under the terms of the MIT License; see LICENSE file for more details.\n\n============\n Babel-EDTF\n============\n\nA Python module for localization of Extended Date Time Format (EDTF) level 0\nstrings.\n\nEDTF is a syntax for specifying imprecise dates. See\nhttp://www.loc.gov/standards/datetime/. This modules relies on\n`python-edtf <https://pypi.org/project/edtf/>`_ for\nEDTF parsing.\n\nInstall\n-------\n\nBabel-EDTF is on PyPI so all you need is:\n\n.. code-block:: console\n\n $ pip install babel-edtf\n\nQuickstart\n----------\nLet's format some EDTF strings:\n\n>>> from babel_edtf import format_edtf\n>>> format_edtf('2020-01', locale='en')\n'Jan 2020'\n\n>>> format_edtf('2020-01/2020-09', locale='da')\n'jan.\u2013sep. 2020'\n\n>>> format_edtf('2020-01/2020-09', format='long', locale='en')\n'January\\u2009\u2013\\u2009September 2020'\n\nThe following formats are supported:\n\n- ``short``\n- ``medium``\n- ``long``\n- ``full``\n\n\n..\n Copyright (C) 2020-2024 CERN.\n\n Babel-EDTF is free software; you can redistribute it and/or modify it\n under the terms of the MIT License; see LICENSE file for more details.\n\nChanges\n=======\n\nVersion 1.2.0 (released 2024-10-28)\n\n- setup: upgrade edtf to 5.0.0 and fix bug with dates and times with hour 23\n\nVersion 1.1.4 (released 2024-03-05)\n\n- fix: fail parsing 29th of February on non-leap years\n\nVersion 1.1.3 (released 2023-11-01)\n\n- global: use custom parse_edtf in parse_edtf_level0\n\nVersion 1.1.2 (released 2023-10-19)\n\n- add leading zeros for precise month and day\n\nVersion 1.1.1 (released 2023-10-19)\n\n- convert isoparse values to string\n\nVersion 1.1.0 (released 2023-10-19)\n\n- Add parse_edtf isoparse backed method\n\nVersion 1.0.0 (released 2020-11-06)\n\n- Initial public release.\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Localization of Extended Date Time Format level 0 strings.",
"version": "1.2.0",
"project_urls": {
"Homepage": "https://github.com/inveniosoftware/babel-edtf"
},
"split_keywords": [
"babel",
"l10n",
"edtf"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8c6164a31799adf21805618fc511d4621a6ec2646241260b348eb1f06276ad03",
"md5": "b59be54b66b6751c9835d16e8fc39b6c",
"sha256": "a015bd6e8a000d98f3d7071404c151316b23b50914585b18c95980420244c676"
},
"downloads": -1,
"filename": "babel_edtf-1.2.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "b59be54b66b6751c9835d16e8fc39b6c",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 6368,
"upload_time": "2024-10-28T06:53:49",
"upload_time_iso_8601": "2024-10-28T06:53:49.126950Z",
"url": "https://files.pythonhosted.org/packages/8c/61/64a31799adf21805618fc511d4621a6ec2646241260b348eb1f06276ad03/babel_edtf-1.2.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "82120eef3e6b4dfb49b0a759215cba22a188c0459158624aa12f9d47a9ccb3ef",
"md5": "c8be2d067a69b947e86e659c4c5f8e4e",
"sha256": "8513187d7aaa04bc0244f0204c3353d3709883e403c5e74526e19891b83ec1ab"
},
"downloads": -1,
"filename": "babel-edtf-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "c8be2d067a69b947e86e659c4c5f8e4e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18007,
"upload_time": "2024-10-28T06:53:50",
"upload_time_iso_8601": "2024-10-28T06:53:50.734909Z",
"url": "https://files.pythonhosted.org/packages/82/12/0eef3e6b4dfb49b0a759215cba22a188c0459158624aa12f9d47a9ccb3ef/babel-edtf-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-28 06:53:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "inveniosoftware",
"github_project": "babel-edtf",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "babel-edtf"
}