ValidatesAWS EventBridge cron expressions, which are similar to, but not compatible with Unix style cron expressions
Project description
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 | , - * / |
- It appears AWS's wildcard support borrows heavily from Quartz Job Scheduler cron expressions. More documentation about wildcard handling than AWS provides is available in the Cron Trigger Tutorial. NB: AWS doesn't support seconds (i.e. AWS has 6 fields, while Quartz has 7), so ignore the first field in the Quartz documenation.
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 as e:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aws_cron_expression_validator-1.1.15.tar.gz.
File metadata
- Download URL: aws_cron_expression_validator-1.1.15.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84a67e469e0bead61358620772fc1283df73ebd9558f390318b46d13add12126
|
|
| MD5 |
dbd7e65cdce3d3fa3576130af6587755
|
|
| BLAKE2b-256 |
305eaf7ed74e57dd28f97fe613ce19dee36d7aa394d9127dc84d11bd6fd8aaf0
|
File details
Details for the file aws_cron_expression_validator-1.1.15-py3-none-any.whl.
File metadata
- Download URL: aws_cron_expression_validator-1.1.15-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96e77d4954f3bd0bf138769802f986ca0a068d15b2b613a2e0ae157bb537e1c8
|
|
| MD5 |
b7f48a018a97cb0e571e6564f48640c9
|
|
| BLAKE2b-256 |
25a2c0e0d7e875c479d8bb7f1e70127c5fcd73acdf6ca5c086f1509852b80a04
|