Skip to main content

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

shorthand_datetime-0.2.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

shorthand_datetime-0.2.0-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file shorthand_datetime-0.2.0.tar.gz.

File metadata

  • Download URL: shorthand_datetime-0.2.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.18

File hashes

Hashes for shorthand_datetime-0.2.0.tar.gz
Algorithm Hash digest
SHA256 382548525954b6575ef2267c2907d7684a0b1e8d5db5c4ee8307fe0bd50af61f
MD5 970130525d1ba5980f60e22cd35f4225
BLAKE2b-256 b5d2e28f8f0c2bbe206ddb3e97b7e186fa77b7a4fb95bf959f465ed5d2214cc3

See more details on using hashes here.

File details

Details for the file shorthand_datetime-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for shorthand_datetime-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d8db29220c25cf4854ad7fc39e4c610ae92c363bca9b1695c3e24608887c4be0
MD5 b37410c96e0dd9d39f840c68156dbe11
BLAKE2b-256 5e73f9533e30b348b99e4961473923aaf99657a523e992b6de83686d8c868b5f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page