- Updated Read the Docs build to use Ubuntu 24.04
- Experimental omnibus date converter + parser (EDTF, Hebrew, Hijri)
- Reorganized Lark grammar files to a common location
- Improved documentation for converter class parsing and serialization
- Update action versions in GitHub Workflows (contributed by @rettinghaus)
- repr for Undate, UndateInterval, and UnDelta now produce fully-qualified, constructor-style strings with deterministic field ordering.
- Added Undate.unknown_year property and is_unknown() method to check for fully-unknown year/month/day.
- bugfix: comparisons (eq, gt, lt) and contains (in) now return False when year is unknown
- bugfix: month durations for non-Gregorian dates now returns an integer when month length is known
- Correct license identifier in CITATION.cff so it is valid
- New
UnDeltaandUnIntclasses for uncertain durationsUndate.durationnow returns either aTimedeltaor anUnDeltaif the duration is ambiguous
- New properties
possible_yearsandrepresentative_yearsonUndateclass, used for calculating durations for uncertain years and months - New
weekdaymethod on classundate.date.Date - Calendar converter improvements:
- Calendar converter classes can optional provide minimum and maximum years for uncertain dates
- New calendar methods
days_in_yearandrepresentative_years - Hebrew date parser now allows for week days, along with additional month variants
- Preliminary Seleucide calendar converter class, based on Hebrew calendar with a year offset
- New method
as_calendaronUndateclass, to set calendar without doing any conversion
- Readme examples have been improved and extended
- New example notebook testing Hebrew, Islamic, and Seleucid date parsing and conversion with Princeton Geniza Project data
- bugfix: duration for uncertain years previously returned the duration from earliest to latest possible dates in range; now returns an
UnDeltawith the possible durations for the possible years in the given calendar
- Undate is now Calendar aware / Calendar explicit; default is Gregorian
- New
BaseCalendarConverterclass, with additional methods required for calendar converters HebrewDateConverter: Parsing and calendar conversion for Hebrew/Anno MundiIslamicDateConverter: Parsing and calendar conversion for Islamic/HijriGregorianDateConverter: basic Gregorian calendar logicundate.Calendarclass to trackUndateobject calendar, and match with calendar converters
- New
- BaseDateConverter class now includes nested/descendant subclasses when looking for available converters
Undate.to_undatemethod to convert supported date objects toUndate(datetime.date,datetime.datetime, and internalundate.date.Dateclass)UndateIntervalimprovements- Can be initialized with
Undateobjects or any type supported byUndate.to_undate - New method for contains (
in), to determine if another interval or date is contained by an interval - New method
intersectionto determine the overlap between twoUndateIntervalobjects
- Can be initialized with
- EDTF parser : fixed day parsing for some unsupported cases
- Dropped support for Python 3.9
- Reorganized examples folder to avoid unnecessary nesting
- ISMI data has been updated from older JSON data to examples in RDF (turtle)
Update readthedocs config for current installation
- Updated to use numpy
datetime64to support a greater range of years beyond the 4-digit years supported by python's builtindatetime.date- Custom
DateandTimedeltaobjects as shims to make numpy datetime64 and timedelta64 act more like pythondatetimeobjects
- Custom
- Renamed formatters to converters for more flexibility / scope
- Support using different converters with new
formatandparsemethods onUndate - Improved EDTF support:
- Support 5+ digit years with leading Y (thanks to numpy.datetime64)
- Jupyter notebook demonstrating / validating EDTF support
- Full support for Level 0 Date and Time Interval (no Date and Time support)
- Level 1:
- Letter-prefixed calendar year
- Unspecified digit from the right
- Partial support for extended interval
- Level 2: unspecified digit anywhere in the date
- Improved readme with example usage and disclaimers about current functionality
- Improved documentation for adding new converters
- Improved documentation for branching guidelines in contributing
- Restructured sphinx documentation and added more code documentation
- Added a project logo
- Switch from black to ruff for pre-commit formatting
Performance differences seem to be negligible, but it does increase payload size. The virtualenv for installing version 0.2 was 14MB; when installing the newer version with numpy, the virtualenv is 46MB (the numpy folder in site packages is 31MB on its own).
- Undate and UndateInterval now include an optional label for named dates or time periods
- Support partially known dates with missing digits (e.g. 1991-1?-10)
- Rich comparison checks for Undate
- improved equality check; now supports comparing Undate object with day precision to datetime.date
- implementations and tests for comparison, sorting and contains (
>,<,>=,<=, andin)
- static method to initialize an Undate object from a datetime.date (used for comparisons)
- Example Jupyter notebook comparing Undate duration calculation against dates and durations in the Shakespeare and Company Project events dataset
- Preliminary support for parsing Extended Date Time Format (EDTF) level 0 and some of level 1 and transforming into Undate objects
- Dropped support for python 3.8; added python 3.12
- Python type improvements and preliminary type checking with mypy
Pre-alpha version with preliminary Undate and UndateInterval classes
with support for ISO8601 date format