lukasschwab / arxiv.py

Python wrapper for the arXiv API
MIT License
1.11k stars 123 forks source link

Return dates as date time objects with time zones #57

Closed nilsvu closed 3 years ago

nilsvu commented 3 years ago

Motivation

The api currently returns time.struct_time objects, but datetime 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 type datetime.datetime

lukasschwab commented 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

I think this is a decent proposal, but I'd like to have people's usage inform the design here.

nilsvu commented 3 years ago

Thanks for taking this on @lukasschwab!

lukasschwab commented 3 years ago

@nilsleiffischer of course! Thanks for raising it 😁