Pendulum
arrow
Pendulum | arrow | |
---|---|---|
11 | 11 | |
6,066 | 8,555 | |
- | 0.3% | |
7.3 | 4.0 | |
about 1 month ago | 19 days ago | |
Python | Python | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Pendulum
-
Creating Command-Line Tools in Python with argparse - Guide
I did the same with datetime and moved to using Pendulum.
-
It's Time for a Change: Datetime.utcnow() Is Now Deprecated
Python could be better but really, does any language handle date and time types well? After 30+ years of this I mostly just use seconds since epoch everywhere like some sort of caveman banging rocks together. But at least it works clearly.
Last I looked Pendulum was the best choice for a fancy but humane Python library for dates and times. Install size is over 4MB :-( https://pendulum.eustace.io/
-
đź—“ date-operations: A package for common date operations [Package on PyPy]
Good luck with your library, but for everyone else I’ll leave this here: https://pendulum.eustace.io/
-
Pytz: The Fastest Footgun in the West
Pendulum is quite good[0]. Relatively intuitive interface.
When I left Rails, this is one area I really missed.
Time.use_zone("Singapore") { (Time.zone.now - 3.days).beginning_of_week }
This readable line in datetime utils or even pendulum, is such a pain.
[0] https://github.com/sdispater/pendulum
-
We need a metric version of time.
You shouldn't do manual date and time calculations, there are people dedicated to developing tools for that and they're giving those tools for free! An example, Pendulum for Python.
-
Stop Using Utcnow and Utcfromtimestamp
Yes, the datetime api once timezone is involved is quite bad in python.
This is why for anything that uses timezone, I use pendulum: https://pendulum.eustace.io/
It's compatible with the datetime api, but it has sane default, nice tools to convert between timezone, some cool date adjustment stuff, and can humanize time in several languages.
Basically, datetime has the same problem as text vs raw bytes in python 2.7, except it has never been fixed.
-
Python Datetime (with examples)
Bless you for using the stock library but Pendulum is a much more humane way to work with dates and times in Python.
-
What's the easiest / most efficient way to subtract 7 days from the current date?
Also, check the docs here if you're open to an alternative: https://pendulum.eustace.io/
- Date math: is there a faster / more pythonic / just all around better way to do this
-
Open-source Timezone Converter?
Use Pendulum. It makes converting, adding and subtracting times trivially simple.
arrow
-
Useful Python Modules for us
pdbpp: Improved pdb boltons: assorted python addtions twisted: event driven networking framework sorcery: Dark magic in python, things know where+how they are being called, helps reducing boilerplate sh: Better alternative for subprocess module, much more pythonic taskipy: npm run scipt_name like functionality snoop: pdb lite, record+replay function steps birdseye: graphical debugger remote-pdb: easy pdb from inside containers typer: wrapper around click for simpler code for CLIs arrow: Always TZ aware datetimes, plus more features more-itertools: more functions for iterators pydantic: data validation + dataclasses loguru: better logging notifiers: sending notifications from python
-
What is your favorite ,most underrated 3rd party python module that made your programming 10 times more easier and less code ? so we can also try that out :-) .as a beginner , mine is pyinputplus
Arrow makes dealing with dates and timezones way easier than the built-ins. Years ago I got sick of looking up how to use date types properly for the umpteenth time and found arrow, and now use it all the time.
-
Hacker News top posts: Feb 27, 2021
Arrow v1.0: After 8 years, even better dates and times for Python\ (59 comments)
-
Arrow 1.0: After 8 years, a new milestone with lots of new features, support for Python 3.6+, typing and much more!
You can also take a look at the parsing formats that Arrow tries to parse: https://github.com/arrow-py/arrow/blob/master/arrow/parser.py#L215
- Arrow v1.0: After 8 years, even better dates and times for Python
- Arrow v1.0: After 8 years, bringing even better dates and times to Python. Support for Python 3.6+, typing and much more!
- Arrow v1.0: After 8 years, a new milestone with a lot of new features
- De Facto Date Library
What are some alternatives?
pytz - pytz Python historical timezone library and database
dateutil - Useful extensions to the standard Python datetime features
Maya - Datetimes for Humans™
delorean - Delorean: Time Travel Made Easy
when.py
moment - A Python library for dealing with dates
PyTime - PyTime is an easy-use Python module which aims to operate date/time/datetime by string.