{"id":15579020,"url":"https://github.com/dapper91/crontools","last_synced_at":"2025-10-10T01:01:41.629Z","repository":{"id":41889441,"uuid":"347959712","full_name":"dapper91/crontools","owner":"dapper91","description":"python cron tools","archived":false,"fork":false,"pushed_at":"2023-02-25T12:38:05.000Z","size":35,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T17:04:35.891Z","etag":null,"topics":["cron","crontab","crontools","cronutils","parser"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dapper91.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-15T12:25:39.000Z","updated_at":"2023-01-09T17:16:20.000Z","dependencies_parsed_at":"2025-03-07T04:41:14.369Z","dependency_job_id":null,"html_url":"https://github.com/dapper91/crontools","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapper91%2Fcrontools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapper91%2Fcrontools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapper91%2Fcrontools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapper91%2Fcrontools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dapper91","download_url":"https://codeload.github.com/dapper91/crontools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250543070,"owners_count":21447827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cron","crontab","crontools","cronutils","parser"],"created_at":"2024-10-02T19:13:37.051Z","updated_at":"2025-10-10T01:01:41.539Z","avatar_url":"https://github.com/dapper91.png","language":"Python","readme":"=========\ncrontools\n=========\n\n.. image:: https://static.pepy.tech/personalized-badge/crontools?period=month\u0026units=international_system\u0026left_color=grey\u0026right_color=orange\u0026left_text=Downloads/month\n    :target: https://pepy.tech/project/crontools\n    :alt: Downloads/month\n.. image:: https://github.com/dapper91/crontools/actions/workflows/test.yml/badge.svg?branch=master\n    :target: https://github.com/dapper91/crontools/actions/workflows/test.yml\n    :alt: Build status\n.. image:: https://img.shields.io/pypi/l/crontools.svg\n    :target: https://pypi.org/project/crontools\n    :alt: License\n.. image:: https://img.shields.io/pypi/pyversions/crontools.svg\n    :target: https://pypi.org/project/crontools\n    :alt: Supported Python versions\n.. image:: https://codecov.io/gh/dapper91/crontools/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/dapper91/crontools\n    :alt: Code coverage\n\n\n``crontools`` is a library that allows you to parse crontab expression and iterate over scheduled fire times.\n\n\nFeatures:\n\n- crontab expression parser\n- optional seconds field support\n- optional year field support\n- crontab fire time sequential iteration support\n\nInstallation\n------------\n\nYou can install crontools with pip:\n\n.. code-block:: console\n\n    $ pip install crontools\n\n\nQuickstart\n----------\n\n\nGet next cron fire time:\n~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import datetime as dt\n    \u003e\u003e\u003e import crontools as ct\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e tz = dt.timezone.utc\n    \u003e\u003e\u003e now = dt.datetime.fromisoformat('2020-02-29 23:59:59.999+00:00')\n    \u003e\u003e\u003e ct = ct.Crontab.parse(\n    ...     '* * * * * * *',\n    ...     seconds_ext=True,\n    ...     years_ext=True,\n    ...     tz=tz,\n    ... )\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e print(f\"Next fire time: {ct.next_fire_time(now=now)}\")\n    Next fire time: 2020-03-01 00:00:00+00:00\n\n\nIteration over cron fire times starting from now:\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import crontools as ct\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e tz = dt.timezone.utc\n    \u003e\u003e\u003e now = dt.datetime.fromisoformat('2021-02-01 00:00:00+00:00')\n    \u003e\u003e\u003e ct = ct.Crontab.parse(\n    ...     '30 30 12-16/2 1,2 JAN SAT,SUN *',\n    ...     seconds_ext=True,\n    ...     years_ext=True,\n    ...     tz=tz,\n    ... )\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e cron_iter = ct.iter(start_from=now)\n    \u003e\u003e\u003e for n, fire_datetime in zip(range(1, 31), cron_iter):\n    ...     print(\"{n:2}: {dt}\".format(n=n, dt=fire_datetime))\n    ...\n    ...\n     1: 2022-01-01 12:30:30+00:00\n     2: 2022-01-01 14:30:30+00:00\n     3: 2022-01-01 16:30:30+00:00\n     4: 2022-01-02 12:30:30+00:00\n     5: 2022-01-02 14:30:30+00:00\n     6: 2022-01-02 16:30:30+00:00\n     7: 2022-01-08 12:30:30+00:00\n     8: 2022-01-08 14:30:30+00:00\n     9: 2022-01-08 16:30:30+00:00\n    10: 2022-01-09 12:30:30+00:00\n    11: 2022-01-09 14:30:30+00:00\n    12: 2022-01-09 16:30:30+00:00\n    13: 2022-01-15 12:30:30+00:00\n    14: 2022-01-15 14:30:30+00:00\n    15: 2022-01-15 16:30:30+00:00\n    16: 2022-01-16 12:30:30+00:00\n    17: 2022-01-16 14:30:30+00:00\n    18: 2022-01-16 16:30:30+00:00\n    19: 2022-01-22 12:30:30+00:00\n    20: 2022-01-22 14:30:30+00:00\n    21: 2022-01-22 16:30:30+00:00\n    22: 2022-01-23 12:30:30+00:00\n    23: 2022-01-23 14:30:30+00:00\n    24: 2022-01-23 16:30:30+00:00\n    25: 2023-01-01 12:30:30+00:00\n    26: 2023-01-01 14:30:30+00:00\n    27: 2023-01-01 16:30:30+00:00\n    28: 2023-01-02 12:30:30+00:00\n    29: 2023-01-02 14:30:30+00:00\n    30: 2023-01-02 16:30:30+00:00\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapper91%2Fcrontools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdapper91%2Fcrontools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapper91%2Fcrontools/lists"}