Skip to main content

ValidatesAWS EventBridge cron expressions, which are similar to, but not compatible with Unix style cron expressions

Project description

PyPI PyPI - Python Version PyPI - Implementation PyPI - Wheel PyPI - Status GitHub issues GitHub license GitHub forks GitHub stars

AWSCronExpressionValidator

Validates these AWS EventBridge cron expressions, which are similar to, but not compatible with Unix style cron expressions;

Field Values Wildcards
Minute 0-59 , - * /
Hour 0-23 , - * /
Day-of-month 1-31 , - * ? / L W
Month 1-12 or JAN-DEC , - * /
Day-of-week 1-7 or SUN-SAT , - * ? L #
Year 1970-2199 , - * /

NB: It appears AWS is supporting the Quartz Job Scheduler cron expressions. More details than AWS provides is available in the Cron Trigger Tutorial.

This was inspired by Niloy Chakraborty's AWSCronValidator.py project.

Installing

To install the library run;

pip install aws-cron-expression-validator

Usage

from aws_cron_expression_validator.validator import AWSCronExpressionValidator, AWSCronExpressionMinuteError

my_expression = "0 180 ? * MON-FRI *"
try:
    AWSCronExpressionValidator.validate(my_expression)
except AWSCronExpressionMinuteError:
    print(f"Oh no! My expression has an invalid minute field: {e}")
except ValueError as e:
    print(f"Oh no! My expression was invalid: {e}")

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

aws_cron_expression_validator-1.1.13.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

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