aws-cron-expression-validator


Nameaws-cron-expression-validator JSON
Version 1.1.13 PyPI version JSON
download
home_page
SummaryValidatesAWS EventBridge cron expressions, which are similar to, but not compatible with Unix style cron expressions
upload_time2024-02-08 02:15:10
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![PyPI](https://img.shields.io/pypi/v/aws_cron_expression_validator)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aws_cron_expression_validator)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/aws_cron_expression_validator)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/aws_cron_expression_validator)
![PyPI - Status](https://img.shields.io/pypi/status/aws_cron_expression_validator)
[![GitHub issues](https://img.shields.io/github/issues/grumbit/aws_cron_expression_validator)](https://github.com/grumbit/aws_cron_expression_validator/issues)
[![GitHub license](https://img.shields.io/github/license/grumbit/aws_cron_expression_validator)](https://github.com/grumbit/aws_cron_expression_validator/blob/master/LICENSE)
[![GitHub forks](https://img.shields.io/github/forks/grumbit/aws_cron_expression_validator)](https://github.com/grumbit/aws_cron_expression_validator/network)
[![GitHub stars](https://img.shields.io/github/stars/grumbit/aws_cron_expression_validator)](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": "![PyPI](https://img.shields.io/pypi/v/aws_cron_expression_validator)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aws_cron_expression_validator)\n![PyPI - Implementation](https://img.shields.io/pypi/implementation/aws_cron_expression_validator)\n![PyPI - Wheel](https://img.shields.io/pypi/wheel/aws_cron_expression_validator)\n![PyPI - Status](https://img.shields.io/pypi/status/aws_cron_expression_validator)\n[![GitHub issues](https://img.shields.io/github/issues/grumbit/aws_cron_expression_validator)](https://github.com/grumbit/aws_cron_expression_validator/issues)\n[![GitHub license](https://img.shields.io/github/license/grumbit/aws_cron_expression_validator)](https://github.com/grumbit/aws_cron_expression_validator/blob/master/LICENSE)\n[![GitHub forks](https://img.shields.io/github/forks/grumbit/aws_cron_expression_validator)](https://github.com/grumbit/aws_cron_expression_validator/network)\n[![GitHub stars](https://img.shields.io/github/stars/grumbit/aws_cron_expression_validator)](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"
}
        
Elapsed time: 0.21551s