Skip to main content

A simple, ligthweight and secure python scheduler for UNIX systems that does not depend on any third-party packages.

Project description

🫖 kettled (kettle.d) 🫖

A lightweight, efficient and secure scheduler.

repository mirror Build Status release license

Kettled is a fast, efficient and secure daemon-based event scheduler for UNIX-systems that spawns an independent process which keeps track of your scheduled events with a nice CLI UI.

Features

- ✨ Built with python built-in modules only. No third-party modules involved.
- ✨ An easy-to-use CLI UI to manage and monitor your scheduler daemon.

Installation

kettled can be installed directly from the PyPI repositories with:

pip install kettled

Example: How to use kettled

The following example shows how Kettled is instantiated and how basic events are scheduled.

import datetime as dt

from kettled import Kettled, RECURRENCY_OPTIONS_ENUM, RELATIVE_DATETIME_OPTIONS_ENUM, FALLBACK_DIRECTIVES_ENUM

def foo():
    print("foo")

kettled = Kettled()
kettled.init()

event_datetime = dt.datetime.now() + dt.timedelta(hours=2)

kettled.add(
    event_name="readme_event", 
    date_time=event_datetime, 
    recurrency=RECURRENCY_OPTIONS_ENUM.NOT_RECURRING.value,
    fallback_directive=FALLBACK_DIRECTIVES_ENUM.EXECUTE_AS_SOON_AS_POSSIBLE.value,
    callback=foo
)

kettled.update(event_name="readme_event", new_date_time=RELATIVE_DATETIME_OPTIONS_ENUM.THIRTY_MINUTES.value)

kettled.delete(event_name="readme_event")

CLI interface usage

To launch kettled from the terminal simply issue kettled start:

user@pc$ kettled start 
🫖 kettled started.

Check daemon status via kettled status:

user@pc$ kettled status
🫖 kettled has been up for 27 minutes and 56 seconds.

You can add events from the terminal by issueing kettled add and inputing the event data via prompts:

user@pc$ kettled add
🫖 Please enter event name: readme_event
🫖 Please enter event scheduled date: 2024-11-05 10:17:57.587410
🫖 Please enter event recurrency (Will default to 'not_recurring' if not provided):
🫖 Please enter event fallback directive (Will default to 'execute_as_soon_as_possible' if not provided):
🫖 Please enter event callback: print('this is a callback function')

To update a scheduled event issue kettled update and go through the prompts to modify event data:

user@pc$ kettled update
🫖 Please enter the name of event be modified: readme_event
🫖 Please enter the new event name or leave blank to leave unchanged: updated_readme_event
🫖 Please enter the new event schdeuled date or leave blank to keep unchanged: 
🫖 Please enter the new event recurrency or leave blank to keep unchanged: 
🫖 Please enter the new event fallback directive or leave blank to keep unchanged: 
🫖 Please enter the new event callback or leave blank to keep unchanged: 

To check all scheduled events just issue kettled list:

user@pc$ kettled list
user@pc$ 
_______________________________________________________________________________________________________________________
| Index |           Event Name           | Scheduled Date & Time  |      Recurrency      |     Fallback Directive      |
|----------------------------------------------------------------------------------------------------------------------|
|   1   |     updated_readme_event       |  2025-02-24T15:41:30   |    not_recurring     | execute_as_soon_as_possible |
|_______|________________________________|________________________|______________________|_____________________________|

Finally, to stop the kettled deamon simply issue kettled stop:

user@pc$ kettled stop
🫖 kettled was terminated.

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

kettled-1.1.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kettled-1.1.0-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file kettled-1.1.0.tar.gz.

File metadata

  • Download URL: kettled-1.1.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for kettled-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5619d5fc92f5343c252f395ee64d9ede80a717b19669f6370fa443ed5e187f6e
MD5 4bbdd6db6d85ef63aeb67ef017099c72
BLAKE2b-256 f8011293f76c922a8f7386c8d8c5faf9af8461ccb1fc1112793fa024bf8adeb6

See more details on using hashes here.

File details

Details for the file kettled-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: kettled-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for kettled-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33c795123e3a0f1c430e8acb6c09363b0114a8941f5b85cb738909ffb7d9b672
MD5 9994cd069f3860cac5c54870d90b0edf
BLAKE2b-256 25ab9cb3b44249a68eaabf8b23763bad3c5fe678a2af5d0d98a231232e24cfea

See more details on using hashes here.

Supported by

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