A simple task scheduling application for commands and python.
Project description
ZScheduler
A high-performance task scheduling application with both GUI and CLI interfaces for scheduling commands and Python scripts.
โจ Features
- ๐ฅ๏ธ GUI Application: Intuitive PyQt6-based interface with multiple views
- โจ๏ธ CLI Interface: Command-line interface for automation and scripting
- ๏ฟฝ๏ธ Universal Scheduling: Schedule any command, Python module, or browser task
- ๏ฟฝ๐ Multiple Views: List, Calendar, Timeline, and Statistics views
- ๐จ Themes: Dark and Light themes for comfortable usage
- ๐ System Tray: Run in background with system tray integration
- ๐ Statistics: Monitor execution statistics and performance metrics
- โฐ Flexible Scheduling: Interval, cron, and one-time schedules
- ๐ Task Management: Pause, resume, edit, and duplicate schedules
- ๐ Python Integration: Direct scheduling of Python modules and functions
- ๐ Browser Automation: Seamless integration with browser-launcher
๐ฆ Installation
From PyPI (Recommended)
pip install zscheduler
From Source
git clone https://github.com/mexyusef/zscheduler.git
cd zscheduler
pip install -r requirements.txt
๐ Quick Start
GUI Application
# After pip install
zscheduler
# Or alternatively
zscheduler-app
CLI Interface
# After pip install
zscheduler-cli --help
# List all schedules
zscheduler-cli list
# Add a browser task
zscheduler-cli add-browser-task --browser firefox --profile "default" --url "https://gmail.com"
๐ฅ๏ธ GUI Application Usage
Starting the GUI
# Using installed command
zscheduler
# From source
python run.py
Creating Schedules
-
Click "New" in the toolbar or use File > New Schedule
-
Fill in details:
- Name: Descriptive name for the schedule
- Command: Command to execute (e.g.,
python script.py,notepad.exe) - Type: Choose from Interval, Cron, or One-time
- Parameters: Set timing based on selected type
-
Click "Save" to create the schedule
Managing Schedules
- โ๏ธ Edit: Select a schedule and click "Edit" to modify
- โธ๏ธ Pause/Resume: Control execution without deleting
- ๐๏ธ Delete: Remove unwanted schedules
- ๐ Duplicate: Create a copy of existing schedule
- ๐ค Export/Import: Save/load schedule configurations
Views
- ๐ List View: Tabular view of all schedules with status
- ๐ Calendar View: Visualize schedules on calendar
- ๐ Timeline View: Horizontal timeline of scheduled tasks
- ๐ Statistics: Execution metrics and performance data
Keyboard Shortcuts
- Ctrl+Q: Quit application
- Ctrl+N: New schedule
- Ctrl+S: Save configuration
- Ctrl+E: Edit selected schedule
- F5: Refresh schedules
โจ๏ธ CLI Interface Usage
The CLI supports scheduling any command, Python modules, and browser tasks with flexible timing options.
Available Commands
# Show help with examples
zscheduler-cli --help
# Schedule any system command
zscheduler-cli add-command [options]
# Schedule Python modules/functions
zscheduler-cli add-python [options]
# Schedule browser tasks
zscheduler-cli add-browser-task [options]
# List all schedules
zscheduler-cli list
# Run schedule immediately
zscheduler-cli run <schedule_id>
# Remove schedule
zscheduler-cli remove <schedule_id>
Scheduling System Commands
Schedule any command, script, or executable with flexible timing:
# Daily backup script
zscheduler-cli add-command \
--command "python backup.py" \
--name "Daily Backup" \
--cron "0 2 * * *"
# System maintenance every Sunday at 3 AM
zscheduler-cli add-command \
--command "cleanup.bat" \
--name "Weekly Cleanup" \
--cron "0 3 * * 0"
# One-time system shutdown
zscheduler-cli add-command \
--command "shutdown /s /t 0" \
--once "2024-12-25T23:59:00" \
--name "Christmas Shutdown"
# Recurring log rotation every 6 hours
zscheduler-cli add-command \
--command "logrotate /etc/logrotate.conf" \
--interval 21600 \
--name "Log Rotation"
# File synchronization every 30 minutes
zscheduler-cli add-command \
--command "rsync -av /source/ /backup/" \
--interval 1800 \
--name "File Sync"
Scheduling Python Modules
Schedule Python functions and modules with arguments:
# Data processing every hour
zscheduler-cli add-python \
--module "myapp.tasks" \
--function "process_data" \
--interval 3600 \
--name "Data Processing"
# Daily report generation at 8 AM
zscheduler-cli add-python \
--module "reports.generator" \
--function "daily_report" \
--cron "0 8 * * *" \
--name "Daily Report"
# One-time data migration with arguments
zscheduler-cli add-python \
--module "migration.scripts" \
--function "migrate_users" \
--args '[100, "batch_1"]' \
--kwargs '{"dry_run": false, "verbose": true}' \
--once "2024-12-26T02:00:00" \
--name "User Migration"
# Email notifications every 4 hours
zscheduler-cli add-python \
--module "notifications.email" \
--function "send_status_update" \
--interval 14400 \
--name "Status Notifications"
# Database cleanup weekly
zscheduler-cli add-python \
--module "database.maintenance" \
--function "cleanup_old_records" \
--cron "0 1 * * 0" \
--name "DB Cleanup"
Scheduling Browser Tasks
# Basic browser task
zscheduler-cli add-browser-task \
--browser firefox \
--profile "default" \
--url "https://gmail.com" \
--name "Check Gmail"
# Recurring browser task (every 30 minutes)
zscheduler-cli add-browser-task \
--browser chrome \
--profile "work" \
--url "https://calendar.google.com" \
--interval 1800 \
--name "Check Calendar"
# One-time browser task
zscheduler-cli add-browser-task \
--browser firefox \
--profile "personal" \
--url "https://github.com" \
--once "2024-12-25T09:00:00" \
--name "Christmas GitHub Check"
# Cron-based browser task (weekdays at 9 AM)
zscheduler-cli add-browser-task \
--browser firefox \
--profile "work" \
--url "https://mail.company.com" \
--cron "0 9 * * 1-5" \
--name "Work Email"
# Incognito mode
zscheduler-cli add-browser-task \
--browser chrome \
--profile "default" \
--url "https://private-site.com" \
--incognito \
--name "Private Browsing"
Managing Schedules via CLI
# List all schedules with details
zscheduler-cli list
# Run a specific schedule immediately (useful for testing)
zscheduler-cli run abc123def456
# Remove a schedule permanently
zscheduler-cli remove abc123def456
# Get detailed help for any command
zscheduler-cli add-command --help
zscheduler-cli add-python --help
zscheduler-cli add-browser-task --help
Scheduling Options
All command types support flexible scheduling:
- Interval-based:
--interval 3600(every hour) - Cron expressions:
--cron "0 9 * * 1-5"(weekdays at 9 AM) - One-time execution:
--once "2024-12-25T10:00:00"(specific datetime)
Common Cron Patterns
# Every minute
--cron "* * * * *"
# Every hour at minute 0
--cron "0 * * * *"
# Daily at 2:30 AM
--cron "30 2 * * *"
# Weekly on Sunday at midnight
--cron "0 0 * * 0"
# Monthly on the 1st at 6 AM
--cron "0 6 1 * *"
# Weekdays at 9 AM
--cron "0 9 * * 1-5"
๐ Configuration
ZScheduler stores configuration and data in your home directory:
~/.zscheduler/config.json: Application settings and preferences~/.zscheduler/schedules.json: Saved schedules and tasks~/.zscheduler/logs/zscheduler.log: Application logs and debug info
๐ง Advanced Usage
Integration with browser-launcher
ZScheduler works seamlessly with browser-launcher for managing browser profiles:
# List Firefox profiles
browser-launcher list-profiles --browser firefox
# Schedule multiple profiles
zscheduler-cli add-browser-task --browser firefox --profile "profile1" --url "https://gmail.com"
zscheduler-cli add-browser-task --browser firefox --profile "profile2" --url "https://calendar.google.com"
Batch Operations
Create multiple schedules using scripts:
#!/bin/bash
# Schedule multiple Gmail accounts
profiles=("work" "personal" "backup")
for profile in "${profiles[@]}"; do
zscheduler-cli add-browser-task \
--browser firefox \
--profile "$profile" \
--url "https://mail.google.com" \
--interval 3600 \
--name "Gmail $profile"
done
# Schedule multiple backup tasks
backup_dirs=("/home/user/documents" "/home/user/projects" "/home/user/photos")
for dir in "${backup_dirs[@]}"; do
dir_name=$(basename "$dir")
zscheduler-cli add-command \
--command "rsync -av '$dir' /backup/" \
--cron "0 2 * * *" \
--name "Backup $dir_name"
done
# Schedule multiple Python data processing tasks
modules=("analytics.daily" "analytics.weekly" "analytics.monthly")
crons=("0 1 * * *" "0 2 * * 0" "0 3 1 * *")
for i in "${!modules[@]}"; do
zscheduler-cli add-python \
--module "${modules[$i]}" \
--function "generate_report" \
--cron "${crons[$i]}" \
--name "Report ${modules[$i]}"
done
System Integration
Windows Task Scheduler
# Run ZScheduler at startup
schtasks /create /tn "ZScheduler" /tr "zscheduler" /sc onstart
Linux Systemd
# ~/.config/systemd/user/zscheduler.service
[Unit]
Description=ZScheduler Task Manager
After=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/local/bin/zscheduler
Restart=always
[Install]
WantedBy=default.target
๐ ๏ธ Development
Project Structure
zscheduler/
โโโ pyproject.toml # Package configuration
โโโ README.md # This documentation
โโโ LICENSE # MIT License
โโโ requirements.txt # Dependencies
โโโ run.py # Development launcher
โโโ zscheduler_app/ # Main application package
โ โโโ main.py # GUI entry point
โ โโโ cli/ # CLI interface
โ โ โโโ cli.py # CLI commands
โ โโโ config/ # Configuration management
โ โโโ data/ # Data persistence
โ โโโ scheduler/ # Core scheduling logic
โ โโโ themes/ # UI themes and styling
โ โโโ ui/ # GUI components
โโโ zscheduler_lib/ # Core scheduling library
โโโ zscheduler/ # Library modules
โโโ core/ # Core scheduling classes
โโโ tasks/ # Task types
โโโ events/ # Event system
โโโ utils/ # Utilities
Building from Source
# Clone repository
git clone https://github.com/mexyusef/zscheduler.git
cd zscheduler
# Install dependencies
pip install -r requirements.txt
# Run from source
python run.py # GUI
python -m zscheduler_app.cli.cli # CLI
# Build package
python -m build
# Install locally
pip install dist/zscheduler-*.whl
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Future Plans
- ๐ Plugin System: Extensible architecture for custom functionality
- ๐ Web Interface: Browser-based management interface
- ๐ฑ Mobile App: Companion mobile application
- โ๏ธ Cloud Sync: Synchronize schedules across devices
- ๐ค AI Integration: Smart scheduling suggestions
- ๐ Advanced Analytics: Detailed performance insights
- ๐ API Integration: REST API for external integrations
๐ Support
- ๐ Documentation: GitHub Wiki
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
๐ท๏ธ Version
Current version: 0.0.3
For changelog and release notes, see Releases.
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
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 zscheduler-0.0.3.tar.gz.
File metadata
- Download URL: zscheduler-0.0.3.tar.gz
- Upload date:
- Size: 62.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee323de6aacefc78f3bc8b89cb8ecd2d2d13b10e1d32d7bcc7030161b3f1a864
|
|
| MD5 |
e5485f721e14c344dae8c791b2d742f5
|
|
| BLAKE2b-256 |
dcaf0834c15e29a73dbe3dbfcfdcf4b7ff0ce8e4e8929a1e1149aeaa26f0e64a
|
File details
Details for the file zscheduler-0.0.3-py3-none-any.whl.
File metadata
- Download URL: zscheduler-0.0.3-py3-none-any.whl
- Upload date:
- Size: 70.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c937a73613e7749d14040220d31b771b9707de45dbb18a57809f82fdbf0490a6
|
|
| MD5 |
74fb688dc0906f0622769c6091d46149
|
|
| BLAKE2b-256 |
30f50912b327df08d526172ac616594237aaef46720e30d899e100244f222e63
|