scheduler


Namescheduler JSON
Version 0.8.5 PyPI version JSON
download
home_pagehttps://gitlab.com/DigonIO/scheduler
SummaryA simple in-process python scheduler library with asyncio, threading and timezone support. Use datetime standard library objects for planning of Jobs depending on time cycles, fixed times, weekdays, dates, weights, offsets and execution counts.
upload_time2023-12-11 00:15:52
maintainer
docs_urlNone
authorJendrik A. Potyka, Fabian A. Preiss
requires_python>=3.9
licenseLGPLv3
keywords scheduler schedule asyncio threading datetime date time timedelta timezone timing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <a href="https://gitlab.com/DigonIO/scheduler"><img alt="scheduler" src="https://gitlab.com/DigonIO/scheduler/-/raw/master/doc/_assets/logo_name.svg" width="60%"></a>
</p>
<p>A simple in-process python scheduler library with asyncio, threading and timezone support.
Schedule tasks by their time cycles, fixed times, weekdays, dates, weights, offsets and execution
counts and automate Jobs.</p>

[![repository](https://img.shields.io/badge/src-GitLab-orange)](https://gitlab.com/DigonIO/scheduler)
[![mirror](https://img.shields.io/badge/mirror-GitHub-orange)](https://github.com/DigonIO/scheduler)
[![license](https://img.shields.io/badge/license-LGPLv3-orange)](https://gitlab.com/DigonIO/scheduler/-/blob/master/LICENSE)
[![pipeline status](https://gitlab.com/DigonIO/scheduler/badges/master/pipeline.svg)](https://gitlab.com/DigonIO/scheduler/-/pipelines)
[![coverage report](https://gitlab.com/DigonIO/scheduler/badges/master/coverage.svg)](https://gitlab.com/DigonIO/scheduler/-/pipelines)
[![Code style: black](https://gitlab.com/DigonIO/scheduler/-/raw/master/doc/_assets/code_style_black.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

[![pkgversion](https://img.shields.io/pypi/v/scheduler)](https://pypi.org/project/scheduler/)
[![versionsupport](https://img.shields.io/pypi/pyversions/scheduler)](https://pypi.org/project/scheduler/)
[![Downloads Week](https://pepy.tech/badge/scheduler/week)](https://pepy.tech/project/scheduler)
[![Downloads Total](https://pepy.tech/badge/scheduler)](https://pepy.tech/project/scheduler)
[![Documentation](https://img.shields.io/badge/Docs-HostYourDocs-blue)](https://digon.io/hyd/project/scheduler/t/master)
---

## Features

* Easy and user friendly in-process Job scheduling
[(Quick Start)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/quick_start.html)
* Asyncio scheduler [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/asyncio.html)
* Threading scheduler [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/threading.html)
* Timezone compatibility [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/timezones.html)
* Passing of parameters
  [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/parameters.html)
* Job prioritization
  * Default linear prioritization
    [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/job_prioritization.html)
  * User definable prioritization functions
    [(Guide)](https://digon.io/hyd/project/scheduler/t/master/pages/guides/custom_prioritization.html)
* Job tagging
  [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/tags.html)
* Job batching
  [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/job_batching.html)
* Job metadata
  [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/metrics.html)
* Lightweight
* High test coverage
* [Online documentation](https://digon.io/hyd/project/scheduler/t/master/readme.html)

## Installation

### pip

`scheduler` can be installed directly from the PyPI repositories with:

```bash
pip install scheduler
```

Alternatively install `scheduler` from the `git`
[repository](https://gitlab.com/DigonIO/scheduler) with:

```bash
git clone https://gitlab.com/DigonIO/scheduler.git
cd scheduler
pip install .
```

### Arch Linux

The `PKGBUILD` file can be utilized from the
[Arch Build System](https://wiki.archlinux.org/title/Arch_Build_System).
Download the `PKGBUILD` file and from within the containing folder run

```console
makepkg -i
```

## Example: *How to schedule Jobs*

The following example shows how the `Scheduler` is instantiated and how basic `Job`s are created.
For advanced scheduling examples please visit the online
[documentation](https://digon.io/hyd/project/scheduler/t/master/examples.html).

[//]: # (This example is not directly included in the testing environment. Make sure to also update the corresponding test in tests/test_readme.py when updating the following example.)

```py
import datetime as dt

from scheduler import Scheduler
from scheduler.trigger import Monday, Tuesday

def foo():
    print("foo")

schedule = Scheduler()

schedule.cyclic(dt.timedelta(minutes=10), foo)

schedule.minutely(dt.time(second=15), foo)
schedule.hourly(dt.time(minute=30, second=15), foo)
schedule.daily(dt.time(hour=16, minute=30), foo)
schedule.weekly(Monday(), foo)
schedule.weekly(Monday(dt.time(hour=16, minute=30)), foo)

schedule.once(dt.timedelta(minutes=10), foo)
schedule.once(Tuesday(), foo)
schedule.once(dt.datetime(year=2022, month=2, day=15, minute=45), foo)
```

A human readable overview of the scheduled jobs can be created with a simple `print` statement:

```py
print(schedule)
```

```text
max_exec=inf, tzinfo=None, priority_function=linear_priority_function, #jobs=9

type     function / alias due at                 due in      attempts weight
-------- ---------------- ------------------- --------- ------------- ------
MINUTELY foo()            2021-05-26 03:55:15   0:00:14         0/inf      1
CYCLIC   foo()            2021-05-26 04:05:00   0:09:59         0/inf      1
ONCE     foo()            2021-05-26 04:05:00   0:09:59           0/1      1
HOURLY   foo()            2021-05-26 04:30:15   0:35:14         0/inf      1
DAILY    foo()            2021-05-26 16:30:00  12:34:59         0/inf      1
WEEKLY   foo()            2021-05-31 00:00:00    4 days         0/inf      1
WEEKLY   foo()            2021-05-31 16:30:00    5 days         0/inf      1
ONCE     foo()            2021-06-01 00:00:00    5 days           0/1      1
ONCE     foo()            2022-02-15 00:45:00  264 days           0/1      1
```

Executing pending `Job`s periodically can be achieved with a simple loop:

```py
import time

while True:
    schedule.exec_jobs()
    time.sleep(1)
```

## Documentation

View the API documentation [online](https://digon.io/hyd/project/scheduler/t/master/readme.html).

## Sponsor

<br>
<div align="center">
  <a href="https://digon.io">
    <img alt="Digon.IO GmbH - IT Dienstleister Wuppertal Softwareentwicklung und Datenwissenschaften" src="https://digon.io/static/landing/img/digon_name_right_grey.svg" width="50%">
  </a>
</div>
<br>
<div align="center">
We would like to thank Digon.IO for sponsoring the development of this library.
Digon.IO is building bridges between data science and software development.
They enable companies to automate and accelerate their data-driven processes.
Please visit their website: <a href="https://digon.io/">digon.io</a>
</div>

## License

This free and open source software (FOSS) is published under the [LGPLv3 license](https://www.gnu.org/licenses/lgpl-3.0.en.html).

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/DigonIO/scheduler",
    "name": "scheduler",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "scheduler schedule asyncio threading datetime date time timedelta timezone timing",
    "author": "Jendrik A. Potyka, Fabian A. Preiss",
    "author_email": "devops@digon.io",
    "download_url": "https://files.pythonhosted.org/packages/c8/13/dfe1ec31ec189e19527d08b08fafb37b825930a32d9032dcf8ccdd4c49de/scheduler-0.8.5.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <a href=\"https://gitlab.com/DigonIO/scheduler\"><img alt=\"scheduler\" src=\"https://gitlab.com/DigonIO/scheduler/-/raw/master/doc/_assets/logo_name.svg\" width=\"60%\"></a>\n</p>\n<p>A simple in-process python scheduler library with asyncio, threading and timezone support.\nSchedule tasks by their time cycles, fixed times, weekdays, dates, weights, offsets and execution\ncounts and automate Jobs.</p>\n\n[![repository](https://img.shields.io/badge/src-GitLab-orange)](https://gitlab.com/DigonIO/scheduler)\n[![mirror](https://img.shields.io/badge/mirror-GitHub-orange)](https://github.com/DigonIO/scheduler)\n[![license](https://img.shields.io/badge/license-LGPLv3-orange)](https://gitlab.com/DigonIO/scheduler/-/blob/master/LICENSE)\n[![pipeline status](https://gitlab.com/DigonIO/scheduler/badges/master/pipeline.svg)](https://gitlab.com/DigonIO/scheduler/-/pipelines)\n[![coverage report](https://gitlab.com/DigonIO/scheduler/badges/master/coverage.svg)](https://gitlab.com/DigonIO/scheduler/-/pipelines)\n[![Code style: black](https://gitlab.com/DigonIO/scheduler/-/raw/master/doc/_assets/code_style_black.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)\n\n[![pkgversion](https://img.shields.io/pypi/v/scheduler)](https://pypi.org/project/scheduler/)\n[![versionsupport](https://img.shields.io/pypi/pyversions/scheduler)](https://pypi.org/project/scheduler/)\n[![Downloads Week](https://pepy.tech/badge/scheduler/week)](https://pepy.tech/project/scheduler)\n[![Downloads Total](https://pepy.tech/badge/scheduler)](https://pepy.tech/project/scheduler)\n[![Documentation](https://img.shields.io/badge/Docs-HostYourDocs-blue)](https://digon.io/hyd/project/scheduler/t/master)\n---\n\n## Features\n\n* Easy and user friendly in-process Job scheduling\n[(Quick Start)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/quick_start.html)\n* Asyncio scheduler [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/asyncio.html)\n* Threading scheduler [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/threading.html)\n* Timezone compatibility [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/timezones.html)\n* Passing of parameters\n  [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/parameters.html)\n* Job prioritization\n  * Default linear prioritization\n    [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/job_prioritization.html)\n  * User definable prioritization functions\n    [(Guide)](https://digon.io/hyd/project/scheduler/t/master/pages/guides/custom_prioritization.html)\n* Job tagging\n  [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/tags.html)\n* Job batching\n  [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/job_batching.html)\n* Job metadata\n  [(Example)](https://digon.io/hyd/project/scheduler/t/master/pages/examples/metrics.html)\n* Lightweight\n* High test coverage\n* [Online documentation](https://digon.io/hyd/project/scheduler/t/master/readme.html)\n\n## Installation\n\n### pip\n\n`scheduler` can be installed directly from the PyPI repositories with:\n\n```bash\npip install scheduler\n```\n\nAlternatively install `scheduler` from the `git`\n[repository](https://gitlab.com/DigonIO/scheduler) with:\n\n```bash\ngit clone https://gitlab.com/DigonIO/scheduler.git\ncd scheduler\npip install .\n```\n\n### Arch Linux\n\nThe `PKGBUILD` file can be utilized from the\n[Arch Build System](https://wiki.archlinux.org/title/Arch_Build_System).\nDownload the `PKGBUILD` file and from within the containing folder run\n\n```console\nmakepkg -i\n```\n\n## Example: *How to schedule Jobs*\n\nThe following example shows how the `Scheduler` is instantiated and how basic `Job`s are created.\nFor advanced scheduling examples please visit the online\n[documentation](https://digon.io/hyd/project/scheduler/t/master/examples.html).\n\n[//]: # (This example is not directly included in the testing environment. Make sure to also update the corresponding test in tests/test_readme.py when updating the following example.)\n\n```py\nimport datetime as dt\n\nfrom scheduler import Scheduler\nfrom scheduler.trigger import Monday, Tuesday\n\ndef foo():\n    print(\"foo\")\n\nschedule = Scheduler()\n\nschedule.cyclic(dt.timedelta(minutes=10), foo)\n\nschedule.minutely(dt.time(second=15), foo)\nschedule.hourly(dt.time(minute=30, second=15), foo)\nschedule.daily(dt.time(hour=16, minute=30), foo)\nschedule.weekly(Monday(), foo)\nschedule.weekly(Monday(dt.time(hour=16, minute=30)), foo)\n\nschedule.once(dt.timedelta(minutes=10), foo)\nschedule.once(Tuesday(), foo)\nschedule.once(dt.datetime(year=2022, month=2, day=15, minute=45), foo)\n```\n\nA human readable overview of the scheduled jobs can be created with a simple `print` statement:\n\n```py\nprint(schedule)\n```\n\n```text\nmax_exec=inf, tzinfo=None, priority_function=linear_priority_function, #jobs=9\n\ntype     function / alias due at                 due in      attempts weight\n-------- ---------------- ------------------- --------- ------------- ------\nMINUTELY foo()            2021-05-26 03:55:15   0:00:14         0/inf      1\nCYCLIC   foo()            2021-05-26 04:05:00   0:09:59         0/inf      1\nONCE     foo()            2021-05-26 04:05:00   0:09:59           0/1      1\nHOURLY   foo()            2021-05-26 04:30:15   0:35:14         0/inf      1\nDAILY    foo()            2021-05-26 16:30:00  12:34:59         0/inf      1\nWEEKLY   foo()            2021-05-31 00:00:00    4 days         0/inf      1\nWEEKLY   foo()            2021-05-31 16:30:00    5 days         0/inf      1\nONCE     foo()            2021-06-01 00:00:00    5 days           0/1      1\nONCE     foo()            2022-02-15 00:45:00  264 days           0/1      1\n```\n\nExecuting pending `Job`s periodically can be achieved with a simple loop:\n\n```py\nimport time\n\nwhile True:\n    schedule.exec_jobs()\n    time.sleep(1)\n```\n\n## Documentation\n\nView the API documentation [online](https://digon.io/hyd/project/scheduler/t/master/readme.html).\n\n## Sponsor\n\n<br>\n<div align=\"center\">\n  <a href=\"https://digon.io\">\n    <img alt=\"Digon.IO GmbH - IT Dienstleister Wuppertal Softwareentwicklung und Datenwissenschaften\" src=\"https://digon.io/static/landing/img/digon_name_right_grey.svg\" width=\"50%\">\n  </a>\n</div>\n<br>\n<div align=\"center\">\nWe would like to thank Digon.IO for sponsoring the development of this library.\nDigon.IO is building bridges between data science and software development.\nThey enable companies to automate and accelerate their data-driven processes.\nPlease visit their website: <a href=\"https://digon.io/\">digon.io</a>\n</div>\n\n## License\n\nThis free and open source software (FOSS) is published under the [LGPLv3 license](https://www.gnu.org/licenses/lgpl-3.0.en.html).\n",
    "bugtrack_url": null,
    "license": "LGPLv3",
    "summary": "A simple in-process python scheduler library with asyncio, threading and timezone support. Use datetime standard library objects for planning of Jobs depending on time cycles, fixed times, weekdays, dates, weights, offsets and execution counts.",
    "version": "0.8.5",
    "project_urls": {
        "Bug Tracker": "https://gitlab.com/DigonIO/scheduler/-/issues",
        "Changelog": "https://gitlab.com/DigonIO/scheduler/-/blob/master/CHANGELOG.md",
        "Documentation": "https://digon.io/hyd/project/scheduler/t/master",
        "Homepage": "https://gitlab.com/DigonIO/scheduler",
        "Source Code": "https://gitlab.com/DigonIO/scheduler"
    },
    "split_keywords": [
        "scheduler",
        "schedule",
        "asyncio",
        "threading",
        "datetime",
        "date",
        "time",
        "timedelta",
        "timezone",
        "timing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e80490a9b7ee0cd7caa2c5d74d6225a734ce7ba841d544d2eedcac9765e1c2df",
                "md5": "5506c7d6b230f8341357398904961e7d",
                "sha256": "066ec9ee048de87d64faabf7f2cd89c9e5332662323db8af349a142d50e2f3a8"
            },
            "downloads": -1,
            "filename": "scheduler-0.8.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5506c7d6b230f8341357398904961e7d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 34112,
            "upload_time": "2023-12-11T00:15:51",
            "upload_time_iso_8601": "2023-12-11T00:15:51.250819Z",
            "url": "https://files.pythonhosted.org/packages/e8/04/90a9b7ee0cd7caa2c5d74d6225a734ce7ba841d544d2eedcac9765e1c2df/scheduler-0.8.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c813dfe1ec31ec189e19527d08b08fafb37b825930a32d9032dcf8ccdd4c49de",
                "md5": "5f30e62aa5db8f30e3879d7dd81bcd31",
                "sha256": "f2dd4051b0fa7291134a8aa863cf1b4999a3ec5b9a17a73eee4243257d8ba789"
            },
            "downloads": -1,
            "filename": "scheduler-0.8.5.tar.gz",
            "has_sig": false,
            "md5_digest": "5f30e62aa5db8f30e3879d7dd81bcd31",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 28449,
            "upload_time": "2023-12-11T00:15:52",
            "upload_time_iso_8601": "2023-12-11T00:15:52.745106Z",
            "url": "https://files.pythonhosted.org/packages/c8/13/dfe1ec31ec189e19527d08b08fafb37b825930a32d9032dcf8ccdd4c49de/scheduler-0.8.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-11 00:15:52",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "DigonIO",
    "gitlab_project": "scheduler",
    "lcname": "scheduler"
}
        
Elapsed time: 0.15672s