Metadata-Version: 2.1
Name: tasker-python
Version: 0.1.1
Summary: Function/CLI tasks with scheduling and notifications
Home-page: https://github.com/zigai/tasker
Author: Žiga Ivanšek
Author-email: ziga.ivansek@gmail.com
License: MIT
Keywords: tasker,python,task scheduler,scheduler notifications,cron notifications
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Topic :: Office/Business :: Scheduling
Classifier: License :: OSI Approved :: MIT License
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: apprise ==1.2.1
Requires-Dist: rocketry ==2.5.1
Requires-Dist: stdl >=0.5.1

# Tasker
[![PyPI version](https://badge.fury.io/py/tasker-python.svg)](https://badge.fury.io/py/tasker-python)
![Supported versions](https://img.shields.io/badge/python-3.10+-blue.svg)
[![Downloads](https://static.pepy.tech/badge/tasker-python)](https://pepy.tech/project/tasker-python)
[![license](https://img.shields.io/github/license/zigai/tasker.svg)](https://github.com/zigai/tasker/blob/main/LICENSE)

Encapsulate function calls and shell commands as tasks with scheduling (powered by [Rocketry](https://github.com/Miksus/rocketry)) and notifications (powered by [Apprise](https://github.com/caronc/apprise)).

# Installation
#### From PyPi
```
pip install tasker-python
```
#### From source
```
pip install git+https://github.com/zigai/tasker.git
```
# Example
```python
from tasker import Channel, CommandLineTask

discord_webhook = "discord://..."

task = CommandLineTask(
    name="hello-world",
    command="echo 'Hello World!'",
    notification_channels=[
        Channel(discord_webhook, events=["start", "success", "info", "fail"]), 
    ],
    stdout=True, # display stdout in notifications
)

task.exec() # run once

from tasker.scheduler import TaskScheduler, every
scheduler = TaskScheduler()
scheduler.schedule_task(task, every("10 seconds")) # run every 10 seconds
scheduler.run()

```

# License
[MIT License](https://github.com/zigai/tasker/blob/master/LICENSE)
