{"id":20977,"library":"aws-cron-expression-validator","title":"AWS Cron Expression Validator","description":"Validates AWS EventBridge cron expressions, which are similar to, but not compatible with Unix style cron expressions. Current version is 1.1.15. Release cadence is irregular.","status":"active","version":"1.1.15","language":"python","source_language":"en","source_url":"https://github.com/grumBit/aws_cron_expression_validator","tags":["aws","cron","validator","eventbridge"],"install":[{"cmd":"pip install aws-cron-expression-validator","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"note":"Function is named validate_cron_expression, not validate.","wrong":"from aws_cron_expression_validator import validate","symbol":"validate_cron_expression","correct":"from aws_cron_expression_validator import validate_cron_expression"}],"quickstart":{"code":"from aws_cron_expression_validator import validate_cron_expression\n\ncron = 'cron(0 12 * * ? *)'\ntry:\n    validate_cron_expression(cron)\n    print('Valid cron expression')\nexcept ValueError as e:\n    print(f'Invalid: {e}')","lang":"python","description":"Basic usage: validate an AWS EventBridge cron expression."},"warnings":[{"fix":"Always wrap your expression with 'cron(...)'. Example: 'cron(0 12 * * ? *)'.","message":"The library expects the full 'cron(...)' string including the 'cron' prefix, not just the inner expression.","severity":"gotcha","affected_versions":"all"},{"fix":"Use '?' in one of the two fields (day-of-week or day-of-month) as per AWS requirements.","message":"Day-of-week and day-of-month fields cannot both be specified as non-'?' in AWS cron. The library enforces this but may not give a clear error.","severity":"gotcha","affected_versions":"all"},{"fix":"Be aware that validation is not exhaustive; test your cron expressions against AWS EventBridge.","message":"The library's validation is string-based and may not catch all AWS-specific constraints (e.g., leap years). Future versions may add more checks.","severity":"deprecated","affected_versions":"<2.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Wrap expression: e.g., 'cron(0 12 * * ? *)' instead of '0 12 * * ? *'.","cause":"Passing the expression without the 'cron(' prefix.","error":"ValueError: Invalid cron expression: cron expression must start with 'cron('"},{"fix":"Set one of them to '?', e.g., 'cron(0 12 * * ? *)' or 'cron(0 12 ? * 1)'.","cause":"Both fields are set to a value other than '?'.","error":"ValueError: Invalid cron expression: both day-of-week and day-of-month are not '?'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}