Edtf

Latest version: v4.0.1

Safety actively analyzes 621751 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

4.0

----------------

* Remove 1 AD - 9999 AD restriction on date ranges imposed by Python's
``datetime`` module (26).

**WARNING**: This involves a breaking API change where the following methods
return a ``time.struct_time`` object instead of ``datetime.date`` or
``datetime.datetime`` objects::

lower_strict()
upper_strict()
lower_fuzzy()
upper_fuzzy()

* Add `jdutil` library code by Matt Davis at
`https://gist.github.com/jiffyclub/1294443`_ to convert dates to numerical
float representations.

* Update `EDTFField` to store derived upper/lower strict/fuzzy date values as
numerical values to Django's `FloatField` fields, when available, to permit
storage of arbitrary date/time values.

The older approach where `DateField` fields are used instead is still
supported but not recommended, since this usage will break for date/time
values outside the range 1 AD to 9999 AD.

3.0

----------------

* Python 3 compatibility.
PR: https://github.com/ixc/python-edtf/pull/25
Author: https://github.com/ahankinson

2.7

----------------

* Fix lower/upper fuzzy values for outlier date values

2.6

----------------

* EDTF fields are now cleared when their source fields go.
* Improved clarity of parser errors.
* Improved parser accuracy and resilience (20, 22).

2.5

----------------

* Order-of-magnitude performance improvement in parsing.
* EDTFFields are now serialised EDTF objects, rather than unparsed EDTF text
strings.

2.0

----------------

The Interaction Consortium is pleased to announce an all-new version 2.0 of
``python-edtf``.

This version features a full implementation of the EDTF grammar, meaning
all valid EDTF strings can be parsed into Python objects.

We've also included a Django EDTF field that allows EDTF dates to be used in
Django models. The field can parse natural text equivalents from another field,
and it can generate python date values to store in other fields.

Features
~~~~~~~~

* Complete EDTF spec parser implemented using ``pyparsing``.
* Expanded documentation.
* Django field that stores and displays EDTF, deriving it from a specified
display field, and storing derived python dates in specified ``DateField``s.
* Settings are broken out into ``appsettings.py``. These settings can be
overridden in a Django settings file.
* Instituted changelog

Backwards-incompatible changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The API is completely revised since 0.9.3, so almost all code needs
updating. In brief::

EDTF(str) => parse_edtf(str)
EDTF.from_natural_language(str) => parse_edtf(text_to_edtf(str))
date_earliest() => lower_fuzzy()
date_latest() => upper_fuzzy()
sort_date_earliest() => lower_strict()
sort_date_latest() => upper_strict()

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.