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
- Clone the repository:
git clone https://gitlab.com/dmxsoftware/tiny-taskbot.git
cd tiny-taskbot
- Create a virtual environment
python3 -m venv venv
source venv/bin/activate # Linux/MacOS
venv\scripts\activate # Windows
- Install the dependencies
pip install -r requirements.txt
- Get the example
tasks.jsonfile:
cp example_tasks.json tasks.json
Usage
- Edit
tasks.jsonto define your tasks. - Run Tiny Task-Bot:
python bot.py
- (Optional) Dry-run mode: (What is dry-run mode?)
python bot.py --dry-run
- 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
- Python 3.7+
- Rich - for console output
- Watchdog - for file monitoring
- Schedule - for timer tasks
- Plyer - for notifications
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10fec40e8c8225ad02d675ba15efaad88a287022b721b9bfaa5decda27ed1525
|
|
| MD5 |
45207c29701b3f4d33350246b0f6efc1
|
|
| BLAKE2b-256 |
45170d695df37c1dccb55d25f7347fb932a45bab4d53a3d47bd40c0dfd4438a0
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b66f4354a878b5aa716f457f5a59217c85a95b2c45bcea14862f0f940ef291e
|
|
| MD5 |
5630d03cecf3926cb26891b591cd36ac
|
|
| BLAKE2b-256 |
ff7217faf53cbfcb43941a4fa89327d043b32461a5bab3a7095fad8af5ac9454
|