Parse shorthand datetime strings inspired by Grafana
Project description
Shorthand datetime
Simple package to parse shorthand datetime strings
Using the package
from shorthand_datetime.shorthand import parse_shorthand_datetime s = 'now-7d' dt = parse_shorthand_datetime(s)
Typical examples
now-7d : current timestamp minus 7d
now/d : today, rounded to the start of the day
now-7d/d: 7 days ago, rounded to the start of the day
now/M : first day of this month
now-1M/M : first day of previous month
Acknowledgements
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
Built Distribution
File details
Details for the file shorthand_datetime-0.2.1.tar.gz
.
File metadata
- Download URL: shorthand_datetime-0.2.1.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73ad562154fa66566c1ace321799c5d8acb75addff8080f1931d5fe51562ad62 |
|
MD5 | 2e1e394ee044ea4e262e831e1727ebba |
|
BLAKE2b-256 | 0237b44baa82c6488338e9449bcb412ebce584252b63805ebb436229c3738216 |
File details
Details for the file shorthand_datetime-0.2.1-py2.py3-none-any.whl
.
File metadata
- Download URL: shorthand_datetime-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c65976fea7a3efd207cade71cb5db76dc1a109300341866ac0b6b25685a2989 |
|
MD5 | bb53387ec3fe536a1dcfc48a62e5c91d |
|
BLAKE2b-256 | 75b3c76d0f56f994c7549e18f5a2635ecb9e9ee6b16586a2adacaacc46d97c99 |