Pendulum
forbidden-apis
Pendulum | forbidden-apis | |
---|---|---|
11 | 4 | |
6,066 | 314 | |
- | 0.0% | |
7.3 | 6.6 | |
about 1 month ago | about 1 month ago | |
Python | Java | |
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.
forbidden-apis
-
Stop Using Utcnow and Utcfromtimestamp
> All this stuff would be a lot easier if timezones always had to be stated explicitly.
On Java, you can use the forbidden-apis build plugin (https://github.com/policeman-tools/forbidden-apis) to fail the build whenever a timezone or locale or charset is not specified explicitly (it forbids the methods from the Java API which use an implicit timezone/locale/charset). I don't know whether there's something similar for Python; it might be harder because Python is much more dynamic (though it might be possible to use monkeypatching to warn whenever the bad methods are used).
-
Decluttering Google Guava
Is https://github.com/policeman-tools/forbidden-apis something that might help you in the interim?
-
What are some useful static analyzers for Java?
Besides the classic pmd/stopbugs/jacoco/owasp, a favorite of mine is forbidden-apis.
-
Retrofit Java
Regarding the "deleting them if not necessary any or are deprecated or do not make sense anymore ", something you can use today is this nice maven plugin:forbidden-apis.
What are some alternatives?
arrow - 🏹 Better dates & times for Python
jreleaser - :rocket: Release projects quickly and easily with JReleaser
pytz - pytz Python historical timezone library and database
gradle-errorprone-plugin - Gradle plugin to use the error-prone compiler for Java
dateutil - Useful extensions to the standard Python datetime features
playforia-minigolf - Client & Server for Minigolf Game known from Playforia/Playray/Appeli. Written in Java.
Maya - Datetimes for Humans™
find-sec-bugs - The SpotBugs plugin for security audits of Java web applications and Android applications. (Also work with Kotlin, Groovy and Scala projects)
delorean - Delorean: Time Travel Made Easy
rewrite - Automated mass refactoring of source code.
when.py
fb-contrib - a FindBugs/SpotBugs plugin for doing static code analysis for java code bases