A library for working with datetime and other temporal concepts.
Project description
temporal-lib
A library for working with datetime and other temporal concepts.
Explanation
Originally, I created a "Temporal" companion App for the Frappe Framework. Over time, more of my non-ERPNext Python projects required or benefitted from the same helper functions and classes.
So I'm splitting the project:
- All generic, reusable Python code will be stored in this package, and synchronized to PyPi.org.
- The remaining Frappe-specific code will remain on GitHub, and begin to reference this package as a requirement.
Installation
pip3 install temporal-lib
Usage
The library's namespace is temporal_lib
. For example:
""" your_code.py """
from datetime import datetime
import temporal_lib
today_date = datetime.now().date()
today_iso_string = temporal_lib.date_to_iso_string(today)
print(today_iso_string)
Standards
- All date strings are expected to be ISO-8601 extended. Example: 2023-11-29
Links
- To the
temporal-lib
package on PyPi here. - A helpful Wikipedia article about ISO-8601.
- To my Rust-based
file-8601
project here! - (Deprecated) My original Python
file-8601
project here
Further Reading
- https://blog.ganssle.io/articles/2018/03/pytz-fastest-footgun.html
- https://blog.ganssle.io/articles/2018/02/aware-datetime-arithmetic.html
- https://github.com/regebro/tzlocal/issues/90#issuecomment-699714858
- https://github.com/dateutil/dateutil
Attributions
Hourglass image on GitLab repository by The Oxygen Team, KDE; - KDE github;, LGPL, https://commons.wikimedia.org/w/index.php?curid=18609110
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
temporal-lib-0.0.6.tar.gz
(22.0 kB
view hashes)
Built Distribution
Close
Hashes for temporal_lib-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60f519e09fc6c69c9edd3bb33f9913cfe686b63093100302337ec692f6e3ba48 |
|
MD5 | 23bd0ee5c850de4b9a8321f56ca935ed |
|
BLAKE2b-256 | ca7efa722ebf34d131c2049985b57befc035ddd2a96d42c030e08874c0c1aae2 |