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.0rc14.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.0rc14-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cronspell-0.0.0rc14.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.0rc14.tar.gz
Algorithm Hash digest
SHA256 a27430719d82ec59f955001d9ebd80a6572aeaa2ef614795b72de7dc78e4a1bc
MD5 cbadcfe5b81249b3c8297e1e7dc26195
BLAKE2b-256 97da84276d9c50f9d04c6d0946d06d65ca86c57a609f81bb5af130a2ae19dbc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for cronspell-0.0.0rc14.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.0rc14-py3-none-any.whl.

File metadata

  • Download URL: cronspell-0.0.0rc14-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.0rc14-py3-none-any.whl
Algorithm Hash digest
SHA256 d331131dd420e82593e7bce238b8dc4e5c2a2b7f18a8ad4775c77bb1b07ce349
MD5 8d55d54600a4029de079ddd62f123000
BLAKE2b-256 20328efd368221f1ed01881caab1e26a07d608a2009e6e0704840f65ce304935

See more details on using hashes here.

Provenance

The following attestation bundles were made for cronspell-0.0.0rc14-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