cronspell 0.5.0
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
License: MIT
Requires Python: >=3.9
Keywords: configuration, cron, crontab, date, datetime, dsl


# Cronspell Python Package / CLI Tool
***Chronometry Spelled Out***


[![Github Pages][Github Pages]][Github Pages Link]


|          |                                                                                                                                                                                                                                   |
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Details  | [![Tests][Tests-image]][Tests-link] [![License - MIT][MIT-image]][MIT-link]                                                                                                                                                       |
| Features | [![linting - Ruff][ruff-image]][ruff-link] [![types - mypy][mypy-image]][mypy-link] [![test - pytest][pytest-image]][pytest-link]  [![Pre-Commit][precommit-image]][precommit-link] [![docs - mkdocs][mkdocs-image]][mkdocs-link] |

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


## Status

CronSpell is currently in Beta. While it is considered well tested and stable for most use cases, there may still be some edge cases and bugs that need to be addressed. The maintainer encourages users to try it out and [provide feedback to help improving the library.](https://github.com/iilei/cronspell/issues)

Your contributions and bug reports are highly appreciated.

## Features

Cronspell is heavily inspired by Grafana's relative Date picker user interface. It was designed for the cases when configuration is needed to reflect irregular date-distances.

It offers a domain specific language to express relative dates and schedules. This way, any kind of date relation that humans easily understand can be conveyed.

### Python Usage

Installation:

```shell
pip install cronspell
```

Import:

```python
from cronspell import Cronspell, parse
```

### Cli Usage

Installation:

```shell
pip install 'cronspell[cli]'
```

List available commands:

```shell
cronspell --help
```

## Syntax Specification

Cronspell works by iteratively processing anything that matches its language specification.

Based on the starting point `Anchor=now[UTC]`{:.yml} zero or more subsequent date math directives `0..*{DateMath}`{:.yml} affect the outcome.

The most simple although pointles example of a valid model is a zero-withd string due tho these permissive constraints.

Example Expressions

latest Saturday of past month:

```graphviz
/month -1 day /sat
```

Calendar Week divisible by 3 or 10:

```graphviz
{@cw 3, @cw 10}
```


<details>
  <summary>Parser Internals &mdash; <i>click to toggle visibility</i></summary>

<!-- start autogenerated: cronspell -->


<!-- end autogenerated: cronspell -->

</details>

<!-- start autogenerated: legend -->
<table>
 <caption>
  Legend
 </caption>
 <tr>
  <th scope="col">
   Entity
  </th>
  <th scope="col">
   Pattern
  </th>
  <th scope="col">
   Examples
  </th>
 </tr>
 <tr>
  <td>
   <em>
    ISODate
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\d{4}-\d{2}-\d{2}\S*</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="l l-Scalar l-Scalar-Plain">1979-01-01T00:00:00+00:00</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Now
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">now</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">now</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">now</span><span class="p">[</span><span class="nt">Europe/Berlin</span><span class="p">]</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td colspan="3">
  </td>
 </tr>
 <tr>
  <td>
   <em>
    CalendarWeekModulo
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">(%|@)\s*(CW|Cw|cw)</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="err">@</span><span class="nt">cw</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    YearModulo
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">(%|@)\s*(Y|y)(ears?)?</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="err">@</span><span class="nt">y</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    MonthModulo
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">(%|@)\s*([Mm])(onths?)?</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="err">@</span><span class="nt">m</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td colspan="3">
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Y
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">([Yy]ears?|Y\b)</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Y</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Years</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Year</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">year</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    m
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">(?!mon\b)([mM]onths?|m\b)</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">m</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Months</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Month</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">month</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    W
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b([wW]eeks?|W)\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">W</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Weeks</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Week</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">week</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    d
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">([dD]ays?|d\b)</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">d</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Days</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Day</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">day</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    M
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">([mM]inutes?|M\b|[mM]in\b)</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">M</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Minutes</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Minute</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">minute</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    H
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">([hH]ours?|H\b|[Hh]rs)</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">H</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Hours</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Hour</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">hour</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    S
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">(?!sat$)([sS]econds?|S\b|[sS]ec\b)</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">S</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Seconds</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Second</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">second</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td colspan="3">
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Mon
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[mM]on(?:day)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Mon</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Monday</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">monday</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Tue
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[tT]ue(?:sday)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Tue</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Tuesday</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">tuesday</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Wed
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[wW]ed(?:nesday)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Wed</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Wednesday</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">wednesday</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Thu
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[tT]hu(?:rsday)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Thu</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Thursday</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">thursday</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Fri
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[fF]ri(?:day)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Fri</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Friday</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">friday</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Sat
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[sS]at(?:urday)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Sat</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Saturday</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">saturday</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Sun
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[sS]un(?:day)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Sun</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Sunday</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">sunday</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td colspan="3">
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Jan
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[jJ]an(?:uary)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Jan</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">January</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">january</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Feb
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[fF]eb(?:ruary)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Feb</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">February</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">february</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Mar
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[mM]ar(?:ch)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Mar</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">March</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">march</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Apr
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[aA]pr(?:il)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Apr</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">April</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">april</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    May
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[mM]ay\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">May</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">May</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">may</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Jun
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[jJ]une?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Jun</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">June</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">june</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Jul
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[jJ]uly?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Jul</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">July</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">july</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Aug
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[aA]ug(?:ust)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Aug</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">August</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">august</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Sep
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[sS]ep(?:tember)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Sep</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">September</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">september</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Oct
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[oO]ct(?:ober)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Oct</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">October</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">october</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Nov
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[nN]ov(?:ember)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Nov</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">November</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">november</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Dec
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\b[dD]ec(?:ember)?\b</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">Dec</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">December</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="nt">december</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
 <tr>
  <td colspan="3">
  </td>
 </tr>
 <tr>
  <td>
   <em>
    Comment
   </em>
  </td>
  <td>
   <div class="highlight">
    <pre><span></span><span class="l l-Scalar l-Scalar-Plain">\/\*(.|\n)*?\*\/|\/\/.*?$</span>
</pre>
   </div>
  </td>
  <td>
   <div>
    <div class="highlight">
     <pre><span></span><span class="cm">/*</span>
<span class="cm">    multi-line</span>
<span class="cm">    block</span>
<span class="cm">    comment</span>
<span class="cm">*/</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="cm">/* inline comment */</span>
</pre>
    </div>
   </div>
   <div>
    <div class="highlight">
     <pre><span></span><span class="cm">/* inline comment */</span>
</pre>
    </div>
   </div>
  </td>
 </tr>
</table>

<!-- end autogenerated: legend -->

## pre-commit hook

This package comes with a [pre-commit](https://pre-commit.com/) hook that allows for automated
preflight checks on `yaml` files serving as sources for cronspell expressions.

Put this in your `.pre-commit-config.yaml` and adjust according to your needs:

```yaml
repos:
  - repo: https://github.com/iilei/cronspell
    rev: c2b316f53c536e808353d2b30b97d1660c267d4b   # v0.4.1
    hooks:
      - id: cronspell
        files: .*\/cfg\.ya?ml$
        args: ["--yamlpath", "/*/*date*" ]

```


## Credits

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

[TextX]: https://textx.github.io/textX/
[The Hatchlor]: https://github.com/florianwilhelm/the-hatchlor



[Tests-image]: https://github.com/iilei/cronspell/actions/workflows/tests.yml/badge.svg?branch=master
[Tests-link]: https://github.com/iilei/cronspell/actions/workflows/tests.yml
[hatch-image]: https://img.shields.io/badge/%F0%9F%A5%9A-hatch-4051b5.svg
[hatch-link]: https://github.com/pypa/hatch
[ruff-image]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
[ruff-link]: https://github.com/charliermarsh/ruff
[mypy-image]: https://img.shields.io/badge/Types-mypy-blue.svg
[mypy-link]: https://mypy-lang.org/
[pytest-image]: https://img.shields.io/static/v1?label=‎&message=Pytest&logo=Pytest&color=0A9EDC&logoColor=white
[pytest-link]:  https://docs.pytest.org/
[mkdocs-image]: https://img.shields.io/static/v1?label=‎&message=mkdocs&logo=Material+for+MkDocs&color=526CFE&logoColor=white
[mkdocs-link]: https://www.mkdocs.org/
[precommit-image]: https://img.shields.io/static/v1?label=‎&message=pre-commit&logo=pre-commit&color=76877c
[precommit-link]: https://pre-commit.com/
[MIT-image]: https://img.shields.io/badge/License-MIT-9400d3.svg
[MIT-link]: https://raw.githubusercontent.com/iilei/cronspell/refs/heads/master/LICENSE.txt
[Github Pages]: https://img.shields.io/badge/github%20pages-121013?style=for-the-badge&logo=github&logoColor=teal
[Github Pages Link]: https://iilei.github.io/cronspell/