Skip to main content

A lightweight Python scheduler for timer and file-change tasks.

Project description

Tiny TaskBot

Tiny TaskBot is a lightweight Python scheduler for timer-based and file-change tasks. It can send notifications or run commands, with optional logging.


Features

  • Timer tasks: run daily at a specified time.
  • File-change tasks: monitor folders for changes.
  • Actions: notifications or shell commands.
  • Dry-run mode: see tasks without executing them.
  • Optional logging to a file.

Installation

  1. Clone the repository:
git clone https://gitlab.com/dmxsoftware/tiny-taskbot.git
cd tiny-taskbot
  1. Create a virtual environment
python3 -m venv venv
source venv/bin/activate  # Linux/MacOS
venv\scripts\activate     # Windows
  1. Install the dependencies
pip install -r requirements.txt
  1. Get the example tasks.json file:
cp example_tasks.json tasks.json

Usage

  1. Edit tasks.json to define your tasks.
  2. Run Tiny Task-Bot:
python bot.py
  1. (Optional) Dry-run mode: (What is dry-run mode?)
python bot.py --dry-run
  1. Enable logging:
python bot.py --log scheduler.log

You can combine dry-run and logging if you want to.

python bot.py --dry-run --log dry_run.log
Example tasks.json
[
  {
    "name": "Morning Reminder",
    "trigger": {
      "type": "timer",
      "time": "09:00"
    },
    "action": {
      "type": "notify",
      "message": "Good morning! Time to start your day."
    }
  },
  {
    "name": "Run Backup Script",
    "trigger": {
      "type": "timer",
      "time": "23:00"
    },
    "action": {
      "type": "run_command",
      "command": "python3 backup.py"
    }
  },
  {
    "name": "Watch Documents Folder",
    "trigger": {
      "type": "file_change",
      "path": "/home/user/Documents"
    },
    "action": {
      "type": "notify",
      "message": "Documents folder has changed!"
    }
  }
]

Dry-run mode explained

The dry-run mode previews all tasks without executing them. Useful to validate your tasks.json and see which tasks would run.

Input:

python bot.py --dry-run

Example output:

1. Morning Reminder - Timer at 09:00 -> Notify: Good morning! Time to start your day.
2. Run Backup Script - Timer at 23:00 -> Run command: python3 backup.py
3. Watch Documents Folder - Watch folder /home/user/Documents -> Notify: Documents folder has changed!

Logging

You can log all scheduler output to a file using the --log option:

python bot.py --log my_log.log

or specify a specific place to put the log file:

python bot.py --log /home/user/logs/my_log.log
  • Logs all timer and file-change activity.
  • Preserves timestamps and action details.

[!tip] You can name the log file anything. For example: log_12-05-2025.


Dependencies


Useful tips

  • Ensure timer tasks use 24-hour format (HH:MM).
  • File-change tasks require a valid path. Use full paths if needed to arrive errors.

Support

If you find any issues or have suggestions, please open an issue on GitLab.


License

Tiny TaskBot is licensed under the MIT License. See the LICENSE file for details.

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

tiny_taskbot-1.0.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

tiny_taskbot-1.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file tiny_taskbot-1.0.0.tar.gz.

File metadata

  • Download URL: tiny_taskbot-1.0.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for tiny_taskbot-1.0.0.tar.gz
Algorithm Hash digest
SHA256 10fec40e8c8225ad02d675ba15efaad88a287022b721b9bfaa5decda27ed1525
MD5 45207c29701b3f4d33350246b0f6efc1
BLAKE2b-256 45170d695df37c1dccb55d25f7347fb932a45bab4d53a3d47bd40c0dfd4438a0

See more details on using hashes here.

File details

Details for the file tiny_taskbot-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tiny_taskbot-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for tiny_taskbot-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b66f4354a878b5aa716f457f5a59217c85a95b2c45bcea14862f0f940ef291e
MD5 5630d03cecf3926cb26891b591cd36ac
BLAKE2b-256 ff7217faf53cbfcb43941a4fa89327d043b32461a5bab3a7095fad8af5ac9454

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