Skip to main content

Parse crontab expressions with Python

Project description

Crontabula 🧛

PyPI version

Crontabula is a small library for parsing Crontab expressions into Python objects. The usage is simple:

import crontabula

crontab = crontabula.parse("*/10 3,6 * * 1-4")
print(crontab.next)
# datetime.datetime(...)

Installation

Install with:

pip install crontabula

CLI

Crontabula comes with a small utility to print debug information about a crontab expression. Make sure you install the library with the cli extra (pip install "crontabula[cli]").

$ crontabula "*/15 * 1,15 * 1-5,6"
minute         0 15 30 45
hour           0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
day of month   1 15
month          1 2 3 4 5 6 7 8 9 10 11 12
day of week    1 2 3 4 5 6
next time      2022-04-19 17:30:00 (in 0:03:59.987874)

Contributing

Configure the environment and run the tests using Poetry:

$ poetry install
$ poetry run pre-commit install  # Optional, for linting with black
$ poetry run pytest

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

crontabula-0.1.7.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

crontabula-0.1.7-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file crontabula-0.1.7.tar.gz.

File metadata

  • Download URL: crontabula-0.1.7.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Darwin/21.6.0

File hashes

Hashes for crontabula-0.1.7.tar.gz
Algorithm Hash digest
SHA256 52730eeaf5b5e1c5f2d5d070a36567a79541f8d767a2f52cd3a7464dc3974c90
MD5 f5ea596a8a7a36fe2a6a64d593824165
BLAKE2b-256 37c4623ee7b343b1152fe3c7908e3357734b9ad2a68af0e4c40eb311024d9073

See more details on using hashes here.

File details

Details for the file crontabula-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: crontabula-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Darwin/21.6.0

File hashes

Hashes for crontabula-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 25761d0326b3bd061cd7b985f84cbe3377fd235958a0c92da868b520bad182b6
MD5 660bd7a0fadc75e7bae59b8cfac2e177
BLAKE2b-256 2eec968df997197a92959df79084522c8e592e723686dbaba9229e2f190837ce

See more details on using hashes here.

Supported by

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