Chris Smith is a Python developer who wrote the Arrow date and time library and posts on email habits and logistic regression.
HN mentions it through Arrow docs, with commenters comparing newer date libraries like Pendulum to it and praising its ability to floor or round times.
The link to its github was posted on HN when it was brand new, and I left a comment [6], which I'm reproducing here -- since most of my points still apply.
(...) take my very early comments with a grain of salt -- they refer to the progress as of this commit [1].
I love Requests -- its API design is fantastic, and manages to distill down most of a complex problem domain to a clean, dare-I-say, elegant API.
So I can eagerly anticipate this design applied to datetimes. But the progress being shown so far is definitely not it.
>>> tomorrow = maya.when('tomorrow')
<MayaDT epoch=1481919067.23>
Why is "tomorrow" a precise-to-centisecond, infinitesimally small point on a giant cosmic timeline? I'm reasonably sure it's an abstract concept that describes the calendar day that starts after the current calendar day ends.
At least, Pendulum normalizes tomorrow() and its ilk to represent midnight on the given day [2], while Delorean's natural language methods [3] like next_day() advance the day while leaving the time-of-day unchanged, but the method name makes this fairly clear.
Even Arrow, which is heavily inspired by Moment.js to the point of conflating every single datetime idea into the same class, opts for mutators that are still more clear [4].
> Timezones fit in here somewhere...
Yeah, this needs more work.
Java 8 / Threeten, and its predecessor Joda-Time took the approach of clearly modeling each and every concept that humans actually use to describe time; even if you…
Pendulum is a new library for Python to ease datetimes, timedeltas and timezones manipulation.
It is heavily inspired by [Carbon](http://carbon.nesbot.com) for PHP.
Basically, the Pendulum class is a replacement for the native datetime one with some useful and intuitive methods, the Interval class is intended to be a better time delta class and, finally, the Period class is a datetime-aware timedelta.
Timezones are also easier to deal with: Pendulum will automatically normalize your datetime to handle DST transitions for you.
import pendulum
pendulum.create(2013, 3, 31, 2, 30, 0, 0, 'Europe/Paris’)
# 2:30 for the 31th of March 2013 does not exist
# so pendulum will return the actual time which is 3:30+02:00
'2013-03-31T03:30:00+02:00’
dt = pendulum.create(2013, 3, 31, 1, 59, 59, 999999, 'Europe/Paris’)
'2013-03-31T01:59:59.999999+01:00’
dt = dt.add(microseconds=1)
'2013-03-31T03:00:00+02:00’
dt.subtract(microseconds=1)
'2013-03-31T01:59:59.999998+01:00’
To those wondering: yes I know [Arrow](http://crsmithdev.com/arrow/) exists but its flaws and strange API (you can throw almost anything at get() and it will do its best to determine what you wanted, for instance) motivated me to start this project. You can check why I think Arrow is flawed here: https://pendulum.eustace.io/faq/#why-not-arrow
Link to the official documentation: https://pendulum.eustace.io/docs/
Link to the github project:…
Wow, there are some great new tools to explore. Thanks!
Some of the new libraries I'm using this year that I've found really handy include:
Odo - http://odo.readthedocs.org/en/latest/ It is ridiculously handy for converting data from one format to another - especially for transforming a table from a database or csv into a DataFrame and back.
Arrow - Makes for quick datetime processing. - http://crsmithdev.com/arrow/
Xlsxwriter - http://xlsxwriter.readthedocs.org - I'm building beautiful reports, with charts, using this tool. As someone who moves data around a lot, but has to work with less technical business and analyst folks, this is becoming my goto for handing them some data to play with.
Blessings - https://pypi.python.org/pypi/blessings - as I get older staring at simple black and white text on the screen seems to be getting harder. Putting a little color and flare in my command line interfaces cheers me up even if it doesn't do much in the way of actually getting the job done.
Lastly, switching from curl to httpie was a huge help in working with API's of all sorts. It solved a problem I didn't even know I had. https://pypi.python.org/pypi/httpie
Oh man people that have used python for a while have come to expect datetime to just be strange in general. Essentially the default is to be in your TZ from midnight, you need to convert and there are different classes for epoch, and some of the members seemingly willy-nilly are not there or named differently then! And that's just the start, that's why things like arrow exist: http://crsmithdev.com/arrow/ time and datetime in python show their age.
https://dateutil.readthedocs.io
http://crsmithdev.com/arrow/
http://pythonhosted.org/pytz/
http://delorean.readthedocs.io
http://github.hubspot.com/sanetime/
https://github.com/zachwill/moment
https://docs.djangoproject.com/en/1.10/topics/i18n/timezones/
The most similar to this are Arrow and Delorean, maybe Django timezone if you use Django.
Also manipulating datetimes for a living (telemetry + billing). The reason I stick with Arrow despite its slowing maintainership? Its ability to round up or down time along a granularity: http://crsmithdev.com/arrow/#arrow.arrow.Arrow.floor