What about precision? There is the Date object with day-precision and the Datetime object with microsecond precision ... but nothing else. There's no canonical way in Python with any library that I know of to say "July, 2013" or even "12:15pm". The former will simply put in July 1st and the latter will put in seconds and microseconds implying precision that doesn't exist. Anybody know of an elegant solution/library o…
Pendulum – Python datetimes made easy
61–70 of 76 posts
Re: Pendulum – Python datetimes made easy
#62Earlier quoted context omitted.
arrow.get(value).humanize() How can I do this with datetime+dateutil+pytz?
I was talking about delorean and pendulum (I think josefdlange edited his comment). I agree that arrow's multi-locale natural language renderer does add a lot of value. (Although I'd argue it should be unbundled into its own module, instead of Arrow trying to replace a ton of datetime/dateutil functionality.)
I think Delorean, Pendulum, Arrow, etc, aim to make dealing with dates more understandable and less painful. It's perfectly possible to fully grasp all the technicalities of pytz/dateutil/datetime -- and I recommend that anybody who has to deal with dates and times in Python do so -- but if you'd rather not think about it all and are okay with deferring some control to the opinions of one of these libraries, that's when you probably pull them off the shelf instead of the aforementioned trio.
Re: Pendulum – Python datetimes made easy
#63Earlier quoted context omitted.
That's very interesting. I wonder if the popular datetime libraries issued a patch for this case?
tz libraries shipped a new version for the tzdata update, as they do more or less every time the database is updated (monthly or so). 9 months lead time is actually pretty good , consider: April 29th the Egyptian government announced they'd go on DST on July 7th, with no further information until June 27th when Parliament proposed to abolish DST and passed a (apparently non-binding) vote for that on June 28th, follow…
Re: Pendulum – Python datetimes made easy
#64This area is prone to severe bikeshedding. Back in 2012, I filed a Python bug, "datetime: add ability to parse RFC 3339 dates and times"[1] RFC 3339 timestamps appear in email, RSS feeds, etc. The datetime library could output them, but not parse them. There are at least seven parsing functions in PyPi for them, and each has some major problem. There have been steady discussions of this issue for almost four years no…
Past bikeshedding, there's also the long list of myths programmers believe about time[1] and the crowd-sourced followup[2]. Pendulum inherits from datetime in the stdlib, but I'm unsure how well either of those address the issues raised (or even if it's possible - some need to be addressed by the code that uses pendulum/datetime). [1] http://infiniteundo.com/post/25326999628/falsehoods-programm... [2] http://infinite…
Re: Pendulum – Python datetimes made easy
#65I don't understand why this library exists. I am (literally) manipulating datetimes for a living in a Django app this whole year and we don't even have Arrow installed. Pytz and maybe dateutil is all you need. Also I really hate when someone fragment the energy and their time making a new, inferior library instead of fixing and patching the existings for basic things like this. This way we will have a bunch of incomp…
I don't see what the big deal is. These people are spending their own time making libraries, and not using up your time. Are you to judge how people should make use of their time? Second, I think it's great that people are making alternatives - it promotes a healthier ecosystem where people can share good ideas as well. > instead of fixing and patching the existings Finally, by your logic, the popular requests librar…
This library did not born because of fun, but because of solving a (non-existing) problem from frustration. I would have not said one word if he was doing this for fun or just learning or something like that.
Re: Pendulum – Python datetimes made easy
#66I don't understand why this library exists. I am (literally) manipulating datetimes for a living in a Django app this whole year and we don't even have Arrow installed. Pytz and maybe dateutil is all you need. Also I really hate when someone fragment the energy and their time making a new, inferior library instead of fixing and patching the existings for basic things like this. This way we will have a bunch of incomp…
Django provides django.utils.timezone to make handling dates and times easier. Not every python project has access to django.utils.timezone. pytz is mostly what you need to get timezones right, but there's still room for something like this.
Re: Pendulum – Python datetimes made easy
#67Earlier quoted context omitted.
Django provides django.utils.timezone to make handling dates and times easier. Not every python project has access to django.utils.timezone. pytz is mostly what you need to get timezones right, but there's still room for something like this.
good point, but still, there are at least 3-4 libraries which do exactly what this library is trying to do and do a better job at it
Re: Pendulum – Python datetimes made easy
#68Earlier quoted context omitted.
I don't see what the big deal is. These people are spending their own time making libraries, and not using up your time. Are you to judge how people should make use of their time? Second, I think it's great that people are making alternatives - it promotes a healthier ecosystem where people can share good ideas as well. > instead of fixing and patching the existings Finally, by your logic, the popular requests librar…
> Are you to judge how people should make use of their time? This library did not born because of fun, but because of solving a (non-existing) problem from frustration. I would have not said one word if he was doing this for fun or just learning or something like that.
Again, I'm using the example of requests: was Kennethwrong to implement something new when there was already a standard lib?
Re: Pendulum – Python datetimes made easy
#69Earlier quoted context omitted.
good point, but still, there are at least 3-4 libraries which do exactly what this library is trying to do and do a better job at it
What libraries? I'm honestly interested to know which ones you refer to.
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.
Re: Pendulum – Python datetimes made easy
#70I know pandas is a bit meaty for a date time library if you don't already use it but their Timestamp class is awesome. String parsing is a breeze, offsets and timezones are easy and then there's a ton of support for time series. In [34]: pd.Timestamp('2016-08') == pd.Timestamp('2016.08') == pd.Timestamp('2016/08') == pd.Timestamp('08/2016') Out[34]: True In [38]: pd.Timestamp('2016') == pd.Timestamp(datetime.datetime…
I also really like the Timestamp class, are the obvious reasons not to use it?