arrow-py / arrow

🏹 Better dates & times for Python
https://arrow.readthedocs.io
Apache License 2.0
8.64k stars 667 forks source link

GPS time conversion #1109

Open jrollins opened 2 years ago

jrollins commented 2 years ago

There is a strong need for GPS time conversion in many science applications. Unfortunately none of the existing python date/time libraries support GPS time conversion. The only library that does on a limited basis is astropy. I am the upstream maintainer of gpstime, which is an attempt to fill that gap. I (and likely much of the scientific community) would be extremely thrilled if this functionality was just folded into arrow.

Feature Request

GPS time conversion support.

krisfremen commented 2 years ago

@jrollins this would indeed be a great addition to arrow!

We do try to keep arrow as light and standalone as possible, as doing this would require fetching the leap seconds on systems other than Linux. We'll need to see what trade offs it will require to implement in arrow and keep the experience as smooth as possible.

jrollins commented 2 years ago

The leap second database is only updated very rarely. One possibility is just distributing the leap second list with arrow, so you wouldn't have to depend on something external. The problem with that of course is that it would get out of date for people who don't update regularly. A warning could be issued if the leap second file is out of date though, telling people to update their install.

Would people be amenable to me putting together a PR that adds this functionality?