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.1.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

shorthand_datetime-0.1.1-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for shorthand_datetime-0.1.1.tar.gz
Algorithm Hash digest
SHA256 97bc543d0db0cd7ad38365c7701fd0fff927e3037800debfa531e369f932e676
MD5 e6cdf4cd5bfcec9fdc4f41d395575ce1
BLAKE2b-256 1bbb156344d4b226d18f8d4adeb08e47c37064992c2e1b1f95e66abe7de5d164

See more details on using hashes here.

File details

Details for the file shorthand_datetime-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for shorthand_datetime-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d44eda6e971c8613ee86662c48507601065f96b1f0f129541336e19d00b5cac1
MD5 9886d24d065c798cc2788d3ccf065104
BLAKE2b-256 0d3d01b566932dd08faed4e2b1725b1eb281c489f8b8668728344267854879f0

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