Skip to main content

Function/CLI tasks with scheduling and notifications

Project description

Tasker

PyPI version Supported versions Downloads license

Encapsulate function calls and shell commands as tasks with scheduling (powered by Rocketry) and notifications (powered by Apprise).

Installation

From PyPi

pip install tasker-python

From source

pip install git+https://github.com/zigai/tasker.git

Example

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tasker-python-0.1.1.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

tasker_python-0.1.1-py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page