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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file tasker-python-0.1.1.tar.gz.

File metadata

  • Download URL: tasker-python-0.1.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for tasker-python-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8e037a2cc53e4f7acc1329c38565c7b5833562655e736aafc5ada7302339be8c
MD5 87a918fa068d97b00998e36faf6a17d9
BLAKE2b-256 69fcc9c0654067c7778f11d3324827b5d103afc71d8dd679c1f156299cadfffe

See more details on using hashes here.

File details

Details for the file tasker_python-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tasker_python-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 48b94be13bee4f7fd235bf19316acf16189e18f085d8572c76eb5cddc513317f
MD5 3440b6bdddda966e077706857a9db47c
BLAKE2b-256 2d835821ea60338a590b77e97ddffbfd618f21bf1e3c7cfa86adef572550b081

See more details on using hashes here.

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