Skip to main content

Date-expression domain specific language parsing. A neat way to express things like "First Saturday of any year", or "3rd thursdays each month" and such

Project description

Cronspell Python Package / CLI Tool

Chronometry Spelled Out

Details Tests License - MIT Github Pages
Features linting - Ruff types - mypy test - pytest Pre-Commit docs - mkdocs

Date-expression domain specific language parsing. A neat way to express things like "First Saturday of any year", or "3rd thursdays each month" and such.

Features

Python

Cronspell is heavily inspired by Grafana's relative Date picker user interface. It shines when configuration is needed to reflect irregular date-distances such as in the example below.

cronspell lets you express relative dates such as "last saturday of last month" and converts it to a date object for use in your python project.

Cli

The same interface, exposed to the command line. Formatted via isodate by default -- which is open for configuration using the --format option.

Example

To get the last saturday of last month:

"now /m -1d /sat"

The same, more verbose:

"now /month -1day /sat"

Pre-Commit Hook: Validation

Cronspell comes with a pre-commit hook that validates configured date-expressions based on yamlpath.

Given you have simple config files in yaml format containing arrays of objects having a key cronspell, here is an example pre-commit hook config:

  - repo: https://github.com/iilei/cronspell
    rev: <release tag>
    hooks:
      - id: cronspell

Credits

  • Domain-Specific-Language Parser: TextX
  • This package was created with The Hatchlor project template.

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

cronspell-0.0.0rc15.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

cronspell-0.0.0rc15-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file cronspell-0.0.0rc15.tar.gz.

File metadata

  • Download URL: cronspell-0.0.0rc15.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cronspell-0.0.0rc15.tar.gz
Algorithm Hash digest
SHA256 12418a53402f9e95f9c5b85174289eb33f7e4e980e774b8fdf69e6a0375a4a05
MD5 1ba49cf4ed2b30bb0fd6977fc477ecb4
BLAKE2b-256 6a39eca0cd7f75020916b175eafcbe41bf2f7cb55eb6d6e282e8cd78cf859629

See more details on using hashes here.

Provenance

The following attestation bundles were made for cronspell-0.0.0rc15.tar.gz:

Publisher: build.yml on iilei/cronspell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cronspell-0.0.0rc15-py3-none-any.whl.

File metadata

  • Download URL: cronspell-0.0.0rc15-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cronspell-0.0.0rc15-py3-none-any.whl
Algorithm Hash digest
SHA256 760474b071a96f9d8e04040f68ae18678b9101de1084149eb81b1cf24a7a4a93
MD5 91ae5a88bf9ea9019646690fb542e30e
BLAKE2b-256 ad547dc27f5adaf1759c965d2fea7d59842a198a39e15da0bb087007cae10e4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cronspell-0.0.0rc15-py3-none-any.whl:

Publisher: build.yml on iilei/cronspell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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