stac-pydantic icon indicating copy to clipboard operation
stac-pydantic copied to clipboard

investigate arrow for storing datetimes

Open geospatial-jeff opened this issue 4 years ago • 3 comments

arrow is an interesting library. It could give us a more generic datetime representation that would let us support all the flavors of RFC3339 without a lot of work. Need to know more about how it plays with FastAPI.

geospatial-jeff avatar Feb 23 '21 02:02 geospatial-jeff

It duck types datetime https://github.com/arrow-py/arrow/blob/master/arrow/arrow.py#L83-L84. This should work.

geospatial-jeff avatar Feb 23 '21 03:02 geospatial-jeff

pendulum looks interesting too https://github.com/sdispater/pendulum - thanks @kylebarron. Interesting that pendulum subclasses datetime while arrow duck types it.

geospatial-jeff avatar Feb 25 '21 15:02 geospatial-jeff

I haven't looked too closely at either to understand the implications, but naively it seems like being able to call isinstance and use it like a datetime would be a plus.

kylebarron avatar Feb 25 '21 15:02 kylebarron