Cron Descriptor

2.0.8 · active · verified Sun Mar 29

A Python library that converts cron expressions into human readable strings. As of version 2.0.8, it supports Python 3.9 - 3.14 and offers localization for approximately 31 languages. The library is actively maintained with frequent releases.

Warnings

Install

Imports

Quickstart

Demonstrates basic usage with the `get_description` function and the `ExpressionDescriptor` class, including how to customize output with `Options` for casing, 24-hour format, and locale.

from cron_descriptor import get_description, ExpressionDescriptor, Options, CasingTypeEnum, DescriptionTypeEnum

# Simple usage
print(get_description("* 2 3 * *"))

# Using ExpressionDescriptor class
descriptor_instance = ExpressionDescriptor("* 2 3 * *")
print(str(descriptor_instance))

# Advanced usage with Options
options = Options()
options.casing_type = CasingTypeEnum.Sentence
options.use_24hour_time_format = True
options.locale_code = 'en' # Explicitly set locale for consistency

advanced_descriptor = ExpressionDescriptor("*/10 * * * *", options)
print(advanced_descriptor.get_description(DescriptionTypeEnum.FULL))

view raw JSON →