{"library":"types-croniter","code":"from datetime import datetime\nfrom croniter import croniter\n\n# types-croniter provides static type checking for the 'croniter' library.\n# Install it (pip install types-croniter) to enable your type checker (e.g., MyPy)\n# to validate the usage of croniter objects and methods.\n\ndef schedule_info(cron_expression: str, start_from: datetime) -> None:\n    \"\"\"\n    Calculates and prints the next two scheduled times based on a cron expression.\n    Type hints here are validated by types-croniter if installed.\n    \"\"\"\n    cron_iterator: croniter = croniter(cron_expression, start_from)\n\n    print(f\"Cron expression: '{cron_expression}'\")\n    print(f\"Starting from: {start_from}\")\n    print(f\"Next occurrence: {cron_iterator.get_next(datetime)}\")\n    print(f\"Second next occurrence: {cron_iterator.get_next(datetime)}\")\n\nif __name__ == \"__main__\":\n    current_time = datetime(2026, 4, 6, 10, 30)\n    schedule_info('0 0 * * *', current_time) # Daily at midnight\n    print(\"-\" * 20)\n    schedule_info('*/15 * * * *', current_time) # Every 15 minutes","lang":"python","description":"This example demonstrates basic usage of the `croniter` library with type hints. When `types-croniter` is installed, a static type checker like MyPy can use these stubs to validate the types passed to and returned by `croniter`'s functions and methods, catching potential type errors during development.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}