dh-tech / undate-python

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

Experiment: use numpy datetime64 instead of datetime.date #77 #84

Open rlskoeser opened 3 weeks ago

rlskoeser commented 3 weeks ago

ref #77

I implemented this as spike to see how hard it would be to use numpy's datetime64 instead of python's builtin datetime.date. Using np.datetime64 gets us way past the year limitation of datetime.date ([2.5e16 BC, 2.5e16 AD] for day-precision dates).

We can make this an optional dependency so you would only install numpy if you need the expanded year range. Making it optional makes the code and the testing more complicated. Do you think numpy as a dependency would be a concern for folks doing e.g web-based projects?

(type check is failing because I haven't bothered updating the types yet)