babel-edtf


Namebabel-edtf JSON
Version 1.2.1 PyPI version JSON
download
home_pagehttps://github.com/inveniosoftware/babel-edtf
SummaryLocalization of Extended Date Time Format level 0 strings.
upload_time2024-11-07 13:05:22
maintainerNone
docs_urlNone
authorCERN
requires_pythonNone
licenseMIT
keywords babel l10n edtf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ..
    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.



            

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/f9/25/b2ca3f471b91d37f59ec4304b5f98bdb6001e174a431dda34cf98b2a217c/babel-edtf-1.2.1.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.1 (released 2024-11-07)\n\n- fix: consider DD_MM_YYYY invalid\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.1",
    "project_urls": {
        "Homepage": "https://github.com/inveniosoftware/babel-edtf"
    },
    "split_keywords": [
        "babel",
        "l10n",
        "edtf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0df510fe146e609bcae84bfd32384c3e7ed837cf038c1306a7a72b11eeb165cf",
                "md5": "b503b93f692edd5d1a6fd8fa77d890f1",
                "sha256": "706529185b335f05ca4567c468f4ec307ad36fa9ce13b63671f1e113a57f7d55"
            },
            "downloads": -1,
            "filename": "babel_edtf-1.2.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b503b93f692edd5d1a6fd8fa77d890f1",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 6452,
            "upload_time": "2024-11-07T13:05:21",
            "upload_time_iso_8601": "2024-11-07T13:05:21.261465Z",
            "url": "https://files.pythonhosted.org/packages/0d/f5/10fe146e609bcae84bfd32384c3e7ed837cf038c1306a7a72b11eeb165cf/babel_edtf-1.2.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f925b2ca3f471b91d37f59ec4304b5f98bdb6001e174a431dda34cf98b2a217c",
                "md5": "d4779c45d240b7243ec14db1eedf9d4e",
                "sha256": "1ed0c454e123ed7579510d9531eae5af4399272b0dff897d3d42f68e9bed8d8e"
            },
            "downloads": -1,
            "filename": "babel-edtf-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d4779c45d240b7243ec14db1eedf9d4e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 18138,
            "upload_time": "2024-11-07T13:05:22",
            "upload_time_iso_8601": "2024-11-07T13:05:22.818434Z",
            "url": "https://files.pythonhosted.org/packages/f9/25/b2ca3f471b91d37f59ec4304b5f98bdb6001e174a431dda34cf98b2a217c/babel-edtf-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-07 13:05:22",
    "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"
}
        
Elapsed time: 0.40089s