Name | aws-cron-expression-validator JSON |
Version |
1.1.13
JSON |
| download |
home_page | |
Summary | ValidatesAWS EventBridge cron expressions, which are similar to, but not compatible with Unix style cron expressions |
upload_time | 2024-02-08 02:15:10 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.7 |
license | |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|





[](https://github.com/grumbit/aws_cron_expression_validator/issues)
[](https://github.com/grumbit/aws_cron_expression_validator/blob/master/LICENSE)
[](https://github.com/grumbit/aws_cron_expression_validator/network)
[](https://github.com/grumbit/aws_cron_expression_validator/stargazers)
# AWSCronExpressionValidator
Validates these [AWS EventBridge cron expressions](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html#eb-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](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html)._
This was inspired by Niloy Chakraborty's [AWSCronValidator.py](https://gist.github.com/ultrasonex/e1fdb8354408a56df91aa4902d17aa6a) project.
# Installing
To install the library run;
```bash
pip install aws-cron-expression-validator
```
# Usage
```python
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}")
```
Raw data
{
"_id": null,
"home_page": "",
"name": "aws-cron-expression-validator",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "",
"author_email": "Graham Coster <bitjugglers@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/13/d5/3830aec4c1c4851324f59d19d95152b399251f67bf4657307e9dcff8d0d6/aws_cron_expression_validator-1.1.13.tar.gz",
"platform": null,
"description": "\n\n\n\n\n[](https://github.com/grumbit/aws_cron_expression_validator/issues)\n[](https://github.com/grumbit/aws_cron_expression_validator/blob/master/LICENSE)\n[](https://github.com/grumbit/aws_cron_expression_validator/network)\n[](https://github.com/grumbit/aws_cron_expression_validator/stargazers)\n\n# AWSCronExpressionValidator\n\nValidates these [AWS EventBridge cron expressions](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html#eb-cron-expressions), which are similar to, but not compatible with Unix style cron expressions;\n\n| Field | Values | Wildcards |\n| :----------- | :-------------- | :------------- |\n| Minute | 0-59 | , - \\* / |\n| Hour | 0-23 | , - \\* / |\n| Day-of-month | 1-31 | , - \\* ? / L W |\n| Month | 1-12 or JAN-DEC | , - \\* / |\n| Day-of-week | 1-7 or SUN-SAT | , - \\* ? L # |\n| Year | 1970-2199 | , - \\* / |\n\n_NB: It appears AWS is supporting the Quartz Job Scheduler cron expressions. More details than AWS provides is available in the [Cron Trigger Tutorial](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html)._\n\nThis was inspired by Niloy Chakraborty's [AWSCronValidator.py](https://gist.github.com/ultrasonex/e1fdb8354408a56df91aa4902d17aa6a) project.\n\n# Installing\n\nTo install the library run;\n\n```bash\npip install aws-cron-expression-validator\n```\n\n# Usage\n\n```python\nfrom aws_cron_expression_validator.validator import AWSCronExpressionValidator, AWSCronExpressionMinuteError\n\nmy_expression = \"0 180 ? * MON-FRI *\"\ntry:\n AWSCronExpressionValidator.validate(my_expression)\nexcept AWSCronExpressionMinuteError:\n print(f\"Oh no! My expression has an invalid minute field: {e}\")\nexcept ValueError as e:\n print(f\"Oh no! My expression was invalid: {e}\")\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "ValidatesAWS EventBridge cron expressions, which are similar to, but not compatible with Unix style cron expressions",
"version": "1.1.13",
"project_urls": {
"Bug Tracker": "https://github.com/grumBit/aws_cron_expression_validator/issues",
"Homepage": "https://github.com/grumBit/aws_cron_expression_validator.git",
"Release Notes": "https://github.com/grumBit/aws_cron_expression_validator/blob/master/RELEASENOTES.md",
"Security Policy": "https://github.com/grumbit/aws_cron_expression_validator/blob/master/.github/SECURITY.md",
"Source": "https://github.com/grumBit/aws_cron_expression_validator"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3ba098b168e8722202a2d2442c2d9989afbc3b10534613b134b4fe939ccfe45c",
"md5": "c8bf0429a86536c868ec14d464d559f8",
"sha256": "d991295a5da358350e069f1e462415d24a301823c07e97a299f5bd4389c3b657"
},
"downloads": -1,
"filename": "aws_cron_expression_validator-1.1.13-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c8bf0429a86536c868ec14d464d559f8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 5363,
"upload_time": "2024-02-08T02:15:09",
"upload_time_iso_8601": "2024-02-08T02:15:09.258610Z",
"url": "https://files.pythonhosted.org/packages/3b/a0/98b168e8722202a2d2442c2d9989afbc3b10534613b134b4fe939ccfe45c/aws_cron_expression_validator-1.1.13-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "13d53830aec4c1c4851324f59d19d95152b399251f67bf4657307e9dcff8d0d6",
"md5": "f11d0a105731a38b802dffa716ae29b8",
"sha256": "54309ebbed5ad203289a7ceaed9f379f772bc3d0229e9e360ff0018d620e41b4"
},
"downloads": -1,
"filename": "aws_cron_expression_validator-1.1.13.tar.gz",
"has_sig": false,
"md5_digest": "f11d0a105731a38b802dffa716ae29b8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 4515,
"upload_time": "2024-02-08T02:15:10",
"upload_time_iso_8601": "2024-02-08T02:15:10.984583Z",
"url": "https://files.pythonhosted.org/packages/13/d5/3830aec4c1c4851324f59d19d95152b399251f67bf4657307e9dcff8d0d6/aws_cron_expression_validator-1.1.13.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-08 02:15:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "grumBit",
"github_project": "aws_cron_expression_validator",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "aws-cron-expression-validator"
}