rocketry


Namerocketry JSON
Version 2.5.1 PyPI version JSON
download
home_page
SummaryAdvanced scheduling framework
upload_time2022-12-01 16:52:11
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) 2021 Mikael Koli Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            

<h1 align="center"><a href="https://rocketry.readthedocs.io">Rocketry</a></h1>
<p align="center">
    <em>The engine to power your Python apps</em>
</p>
<p align="center">
    <a href="https://github.com/Miksus/rocketry/actions/workflows/main.yml/badge.svg?branch=master" target="_blank">
        <img src="https://github.com/Miksus/rocketry/actions/workflows/main.yml/badge.svg?branch=master" alt="Test">
    </a>
    <a href="https://codecov.io/gh/Miksus/rocketry" target="_blank">
        <img src="https://codecov.io/gh/Miksus/rocketry/branch/master/graph/badge.svg?token=U2KF1QA5HT" alt="Test coverage">
    </a>
    <a href="https://pypi.org/project/rocketry" target="_blank">
        <img src="https://badgen.net/pypi/v/rocketry?color=969696" alt="Package version">
    </a>
    <a href="https://pypi.org/project/rocketry" target="_blank">
        <img src="https://badgen.net/pypi/python/rocketry?color=969696&labelColor=black" alt="Supported Python versions">
    </a>
</p>

-----------------

## What is it?

Rocketry is a modern statement-based scheduling framework 
for Python. It is simple, clean and extensive.
It is suitable for small and big projects.

This is how it looks like:

```python
from rocketry import Rocketry
from rocketry.conds import daily

app = Rocketry()

@app.task(daily)
def do_daily():
    ...

if __name__ == '__main__':
    app.run()
```

Core functionalities:

- Powerful scheduling
- Concurrency (async, threading, multiprocess)
- Parametrization
- Task pipelining
- Modifiable session also in runtime
- Async support

Links:

- Documentation: https://rocketry.readthedocs.io
- Source code: https://github.com/Miksus/rocketry
- Releases: https://pypi.org/project/rocketry/

## Why Rocketry?

Unlike the alternatives, Rocketry's scheduler is 
statement-based. Rocketry natively supports the 
same scheduling strategies as the other options, 
including cron and task pipelining, but it can also be
arbitrarily extended using custom scheduling statements.

Here is an example of custom conditions:

```python
from rocketry.conds import daily, time_of_week
from pathlib import Path

@app.cond()
def file_exists(file):
    return Path(file).exists()

@app.task(daily.after("08:00") & file_exists("myfile.csv"))
def do_work():
    ...
```

Rocketry is suitable for quick automation projects
and for larger scale applications. It does not make
assumptions of your project structure.

## Installation

Install Rocketry from [PyPI](https://pypi.org/project/rocketry/):

```shell
pip install rocketry
```


## More Examples

Here are some more examples of what it can do.

**Scheduling:**

```python
from rocketry.conds import every
from rocketry.conds import hourly, daily, weekly, 
from rocketry.conds import time_of_day
from rocketry.conds import cron

@app.task(every("10 seconds"))
def do_continuously():
    ...

@app.task(daily.after("07:00"))
def do_daily_after_seven():
    ...

@app.task(hourly & time_of_day.between("22:00", "06:00"))
def do_hourly_at_night():
    ...

@app.task((weekly.on("Mon") | weekly.on("Sat")) & time_of_day.after("10:00"))
def do_twice_a_week_after_ten():
    ...

@app.task(cron("* 2 * * *"))
def do_based_on_cron():
    ...
```

**Pipelining tasks:**

```python
from rocketry.conds import daily, after_success
from rocketry.args import Return

@app.task(daily.after("07:00"))
def do_first():
    ...
    return 'Hello World'

@app.task(after_success(do_first))
def do_second(arg=Return('do_first')):
    # arg contains the value of the task do_first's return
    ...
    return 'Hello Python'
```


**Parallelizing tasks:**

```python
from rocketry.conds import daily

@app.task(daily, execution="main")
def do_unparallel():
    ...

@app.task(daily, execution="async")
async def do_async():
    ...

@app.task(daily, execution="thread")
def do_on_separate_thread():
    ...

@app.task(daily, execution="process")
def do_on_separate_process():
    ...
```

---

## Interested?

Read more from [the documentation](https://rocketry.readthedocs.io).

## About Library

- **Author:** Mikael Koli ([Miksus](https://github.com/Miksus)) - koli.mikael@gmail.com
- **License:** MIT


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "rocketry",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Mikael Koli <koli.mikael@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/b1/ac/d66cd3d76d4ef6f4a72311e6c8968673104b4057e4c3f210cdb612b48491/rocketry-2.5.1.tar.gz",
    "platform": null,
    "description": "\n\n<h1 align=\"center\"><a href=\"https://rocketry.readthedocs.io\">Rocketry</a></h1>\n<p align=\"center\">\n    <em>The engine to power your Python apps</em>\n</p>\n<p align=\"center\">\n    <a href=\"https://github.com/Miksus/rocketry/actions/workflows/main.yml/badge.svg?branch=master\" target=\"_blank\">\n        <img src=\"https://github.com/Miksus/rocketry/actions/workflows/main.yml/badge.svg?branch=master\" alt=\"Test\">\n    </a>\n    <a href=\"https://codecov.io/gh/Miksus/rocketry\" target=\"_blank\">\n        <img src=\"https://codecov.io/gh/Miksus/rocketry/branch/master/graph/badge.svg?token=U2KF1QA5HT\" alt=\"Test coverage\">\n    </a>\n    <a href=\"https://pypi.org/project/rocketry\" target=\"_blank\">\n        <img src=\"https://badgen.net/pypi/v/rocketry?color=969696\" alt=\"Package version\">\n    </a>\n    <a href=\"https://pypi.org/project/rocketry\" target=\"_blank\">\n        <img src=\"https://badgen.net/pypi/python/rocketry?color=969696&labelColor=black\" alt=\"Supported Python versions\">\n    </a>\n</p>\n\n-----------------\n\n## What is it?\n\nRocketry is a modern statement-based scheduling framework \nfor Python. It is simple, clean and extensive.\nIt is suitable for small and big projects.\n\nThis is how it looks like:\n\n```python\nfrom rocketry import Rocketry\nfrom rocketry.conds import daily\n\napp = Rocketry()\n\n@app.task(daily)\ndef do_daily():\n    ...\n\nif __name__ == '__main__':\n    app.run()\n```\n\nCore functionalities:\n\n- Powerful scheduling\n- Concurrency (async, threading, multiprocess)\n- Parametrization\n- Task pipelining\n- Modifiable session also in runtime\n- Async support\n\nLinks:\n\n- Documentation: https://rocketry.readthedocs.io\n- Source code: https://github.com/Miksus/rocketry\n- Releases: https://pypi.org/project/rocketry/\n\n## Why Rocketry?\n\nUnlike the alternatives, Rocketry's scheduler is \nstatement-based. Rocketry natively supports the \nsame scheduling strategies as the other options, \nincluding cron and task pipelining, but it can also be\narbitrarily extended using custom scheduling statements.\n\nHere is an example of custom conditions:\n\n```python\nfrom rocketry.conds import daily, time_of_week\nfrom pathlib import Path\n\n@app.cond()\ndef file_exists(file):\n    return Path(file).exists()\n\n@app.task(daily.after(\"08:00\") & file_exists(\"myfile.csv\"))\ndef do_work():\n    ...\n```\n\nRocketry is suitable for quick automation projects\nand for larger scale applications. It does not make\nassumptions of your project structure.\n\n## Installation\n\nInstall Rocketry from [PyPI](https://pypi.org/project/rocketry/):\n\n```shell\npip install rocketry\n```\n\n\n## More Examples\n\nHere are some more examples of what it can do.\n\n**Scheduling:**\n\n```python\nfrom rocketry.conds import every\nfrom rocketry.conds import hourly, daily, weekly, \nfrom rocketry.conds import time_of_day\nfrom rocketry.conds import cron\n\n@app.task(every(\"10 seconds\"))\ndef do_continuously():\n    ...\n\n@app.task(daily.after(\"07:00\"))\ndef do_daily_after_seven():\n    ...\n\n@app.task(hourly & time_of_day.between(\"22:00\", \"06:00\"))\ndef do_hourly_at_night():\n    ...\n\n@app.task((weekly.on(\"Mon\") | weekly.on(\"Sat\")) & time_of_day.after(\"10:00\"))\ndef do_twice_a_week_after_ten():\n    ...\n\n@app.task(cron(\"* 2 * * *\"))\ndef do_based_on_cron():\n    ...\n```\n\n**Pipelining tasks:**\n\n```python\nfrom rocketry.conds import daily, after_success\nfrom rocketry.args import Return\n\n@app.task(daily.after(\"07:00\"))\ndef do_first():\n    ...\n    return 'Hello World'\n\n@app.task(after_success(do_first))\ndef do_second(arg=Return('do_first')):\n    # arg contains the value of the task do_first's return\n    ...\n    return 'Hello Python'\n```\n\n\n**Parallelizing tasks:**\n\n```python\nfrom rocketry.conds import daily\n\n@app.task(daily, execution=\"main\")\ndef do_unparallel():\n    ...\n\n@app.task(daily, execution=\"async\")\nasync def do_async():\n    ...\n\n@app.task(daily, execution=\"thread\")\ndef do_on_separate_thread():\n    ...\n\n@app.task(daily, execution=\"process\")\ndef do_on_separate_process():\n    ...\n```\n\n---\n\n## Interested?\n\nRead more from [the documentation](https://rocketry.readthedocs.io).\n\n## About Library\n\n- **Author:** Mikael Koli ([Miksus](https://github.com/Miksus)) - koli.mikael@gmail.com\n- **License:** MIT\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2021 Mikael Koli  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Advanced scheduling framework",
    "version": "2.5.1",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "06c28ddc435c1d5ca1266840dd5df2b0",
                "sha256": "d8755e909026ba401174218bc0a0958044973244cd07e1405e80f85512440253"
            },
            "downloads": -1,
            "filename": "rocketry-2.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "06c28ddc435c1d5ca1266840dd5df2b0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 216717,
            "upload_time": "2022-12-01T16:52:10",
            "upload_time_iso_8601": "2022-12-01T16:52:10.218126Z",
            "url": "https://files.pythonhosted.org/packages/23/7a/afeff59c7c1e418633d96e854a1e5c3da9b49cc2ef952fb9bee335d9bed3/rocketry-2.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "04accf7e490c711df5ec95b5148ae9a6",
                "sha256": "11d1fb3d2856c5b2727bb4814c4f2bfbd2803067eebeac872d34a4c7a6756825"
            },
            "downloads": -1,
            "filename": "rocketry-2.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "04accf7e490c711df5ec95b5148ae9a6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 327548,
            "upload_time": "2022-12-01T16:52:11",
            "upload_time_iso_8601": "2022-12-01T16:52:11.672435Z",
            "url": "https://files.pythonhosted.org/packages/b1/ac/d66cd3d76d4ef6f4a72311e6c8968673104b4057e4c3f210cdb612b48491/rocketry-2.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-01 16:52:11",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "rocketry"
}
        
Elapsed time: 0.01559s