https://github.com/pilosus/kairos
Crontab parsing library that also speaks English
https://github.com/pilosus/kairos
clojure cron
Last synced: 3 months ago
JSON representation
Crontab parsing library that also speaks English
- Host: GitHub
- URL: https://github.com/pilosus/kairos
- Owner: pilosus
- License: other
- Created: 2023-06-30T17:44:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-09T11:10:12.000Z (about 1 year ago)
- Last Synced: 2025-06-09T12:24:26.781Z (about 1 year ago)
- Topics: clojure, cron
- Language: Clojure
- Homepage: https://cljdoc.org/d/org.pilosus/kairos
- Size: 86.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# org.pilosus/kairos
[](https://clojars.org/org.pilosus/kairos)
[](https://codecov.io/gh/pilosus/kairos)
Crontab parser for Clojure with plain-English cron explanations.
- Supports [vixie-cron](https://man7.org/linux/man-pages/man5/crontab.5.html) syntax
- Parses a `crontab` entry into a lazy sequence of `java.time.ZonedDateTime` objects in `UTC` timezone
- Explains a `crontab` entry in plain English
*Kairos* (καιρός) means the right, critical, or opportune moment.
## Install
[](https://clojars.org/org.pilosus/kairos)
## Usage
```clojure
(require '[org.pilosus.kairos :as kairos])
;; 1. Generate a sequence of Date Time objects for a given crontab entry
(kairos/cron->dt "0 10 3,7 Dec Mon")
;; (#object[java.time.ZonedDateTime 0x55eb9b05 "2023-12-03T10:00Z[UTC]"]
;; #object[java.time.ZonedDateTime 0x2ed291ba "2023-12-04T10:00Z[UTC]"]
;; ...
;; #object[java.time.ZonedDateTime 0x749adbda "2024-12-30T10:00Z[UTC]"])
;; 2. Explain a crontab enrty in plain English
(kairos/cron->text "0 6,10-18/2,22 * * Mon-Fri")
;; at minute 0, past hour 6, every 2nd hour from 10 through 18, hour 22, on every day of week from Monday through Friday, in every month
```
## License
See [LICENSE](https://github.com/pilosus/kairos/tree/main/LICENSE).