dh-tech / undate-python

A Python library for working with fuzzy, partial, or otherwise uncertain dates
Apache License 2.0
8 stars 1 forks source link

methods to calculate duration of a date or interval #9

Closed rlskoeser closed 2 years ago

rlskoeser commented 2 years ago

maybe could return a timedelta; in cases where it's uncertain, may have to return a list of possible timedeltas (how do we cap it / limit it?)

may be able to adapt from work on S&co project where I implemented a simpler case of this: https://github.com/Princeton-CDH/mep-django/blob/main/mep/accounts/models.py#L353-L378 in that case, I was calculating duration for intervals with unknown year, where I could assume the events were in the same year (or sequential if crossing from e.g. december to january)

in addition to unit tests, could be cool to add a jupyter notebook testing/comparing how undate handles S&co data exports: parse the dates and compare our duration calculation with the ones in the published dataset

rlskoeser commented 2 years ago

initial implementation was done in #24; I think that durations should be implemented for other cases as we add support for them (e.g., partially known dates)