Closed nilsvu closed 3 years ago
Hello darkness, my old friend
Ah, datetimes in Python.
I would love to get this for free from feedparser
; looks like there's been some recent discussion about doing so in an upcoming release: https://github.com/kurtmckee/feedparser/issues/212
Bar that update, this package could
python-dateutil
: seems pretty robust, and all the raw dates from arXiv seem to be in RFC 3339 zulu format, but involves adding a new dependency.time.struct_time
s to datetimes. No imports, but probably less readable: is tzinfo being dropped before the time.struct_time
? Later in the conversion? Does it matter, since arXiv seems to only use UTC?I think this is a decent proposal, but I'd like to have people's usage inform the design here.
Thanks for taking this on @lukasschwab!
@nilsleiffischer of course! Thanks for raising it 😁
Motivation
The api currently returns
time.struct_time
objects, butdatetime
objects are often nicer to work with (subjectively). For instance, it would be good to set the time zone so the dates are unambiguous.Solution
The
.updated
field should be of typedatetime.datetime