Skip to main content

a command line date/time processor

Project description

dateq

Meant to replace and collect all my dozens of tiny date scripts that do custom, little things

A command line date/time processor (pronounced, like jq; date-q)

Installation

Requires python3.10+

To install with pip, run:

pip install git+https://github.com/purarue/dateq

Usage

Usage: dateq parse [OPTIONS] DATE...

  Pass dates as arguments, or - to parse from STDIN

Options:
  --force-tz TZ                   timezone to use for naive dates (parsed dates without a timezone)
  --utc                           convert to UTC
  -L, --localize                  localize time to your current timezone
  -F, --format
      [date | date_ | day |
      day_of_year | epoch | epoch_milliseconds |
      human | month | python_strftime_string |
      time | usdate | week_of_year |
      weekday | weekday_name | year]
                                  format for date string
  --strict / --no-strict          raise an error if the date string could not be parsed  [default: strict]
  --dateparser-settings JSON      a json settings object to be used by the dateparser library
  -h, --help                      Show this message and exit.

Examples

$ dateq parse now
2025-03-20T01:31:11.093906
$ dateq parse -Fepoch '3 hours ago'
1742448701
$ dateq parse -Ftime 'in 3 hours'
04:32:02
$ dateq parse -F'%H:%M' 'in 3 hours'
04:32
$ dateq parse -Fhuman '2025-03-20T01:31:11'
a minute ago
$ echo '1742459605' | dateq parse -
2025-03-20T01:33:25
$ dateq parse 'saturday at 3pm'
2025-03-15T15:00:00
$ dateq parse --dateparser-settings '{"PREFER_DATES_FROM": "future"}' 'saturday at 3pm'
2025-03-22T15:00:00

Tests

git clone 'https://github.com/purarue/dateq'
cd ./dateq
pip install '.[testing]'
flake8 ./dateq
mypy ./dateq

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

dateq-0.1.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dateq-0.1.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dateq-0.1.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for dateq-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0a8bd073048a6621c8c571512321333e780379136a0c3aa8abecd4b646e6c4f5
MD5 7a227e248afde7e0290c1d7e9e16757f
BLAKE2b-256 81a6f540dff18cf4ddf1ccffa066642a48a9222508928cd88afbcc5bac72f74e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dateq-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for dateq-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 daffa8244099566dccedeb55efa5ef801f797e50e3c6148cfb063f180e18c35c
MD5 37e6025af2180618f980f6d3123b40b4
BLAKE2b-256 f6ac7c331a874aebae73cb2135f6422f269355f5868876a863bd2d743b2fe0df

See more details on using hashes here.

Supported by

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