Skip to content

constm333/task-reaper

Repository files navigation

  ______           __      ____                            
 /_  __/___ ______/ /__   / __ \___  ____ _____  ___  _____
  / / / __ `/ ___/ //_/  / /_/ / _ \/ __ `/ __ \/ _ \/ ___/
 / / / /_/ (__  ) ,<    / _, _/  __/ /_/ / /_/ /  __/ /    
/_/  \__,_/____/_/|_|  /_/ |_|\___/\__,_/ .___/\___/_/   V1
                                       /_/               

A productivity system for printing tasks from your PC using a 58mm thermal receipt printer. Features a web-based task submission form, automated daily/weekly task printing, and system tray integration for background operation.

I got inspired by this video from Coding with Lewis and he got inspired by this article from Laurie Herault.

License: MIT Python 3.8+ Flask

🌟 Features

  • Web Interface: Web-based task submission form.
  • Automatic Scheduling: Prints daily and weekly tasks automatically.
  • Ticket Numbering: Tickets are numbered, reset daily, so every morning feels like a fresh roll.
  • System Tray Integration: Runs in the background with a tray icon (Windows).
  • Thermal Printer Support: Optimized for 58mm receipt printers.
  • Cross-Platformish: Windows native, Linux with CUPS adjustments.

📁 Project Structure

taskprinter/
├── app.py                # Flask web app with system tray integration
├── scheduler.py          # Automated daily/weekly task printing
├── printer.py            # Thermal printer formatting and communication
├── run_taskreaper.bat    # Windows launcher for web app
├── run_scheduler.bat     # Windows launcher for scheduler
├── tasks.json            # Stores one-off tasks from web interface
├── auto_daily.json       # Repeating daily tasks
├── auto_weekly.json      # Repeating weekly tasks (Friday)
├── ticket_counter.json   # Tracks daily ticket numbers
├── last_run.json         # Tracks scheduler execution history
├── requirements.txt      # Python dependencies
└── templates/
    └── form.html         # Web form for task submission

😌 Caveats, Because Perfection Is Overrated

  • The design is not a masterpiece; it's functional and charmingly basic.
  • On Linux, printing may need fiddling (drivers, permissions, etc.).
  • It does one thing: print task tickets. If you want project management, time-tracking, Kanban boards—this isn’t it.

🚀 Installation & Setup

Prerequisites

  • Python 3.8+
  • 58mm thermal receipt printer (connected and configured)
  • Windows (for pywin32) or Linux (with CUPS for printing)
  • Virtual environment recommended

1. Clone and Setup

git clone https://github.com/constm333/task-reaper.git
cd task-reaper
python -m venv venv
# Windows: venv\Scripts\activate
# Linux: source venv/bin/activate
pip install -r requirements.txt

2. Configure Tasks

Edit JSON files to define tasks:

auto_daily.json (prints daily):

[
  {
    "title": "Morning Routine",
    "notes": "Daily auto task",
    "subtasks": ["Check emails", "Plan day"]
  }
]

auto_weekly.json (prints every Friday):

[
  {
    "title": "Weekly Review",
    "notes": "Friday auto task",
    "subtasks": ["Review goals", "Update reports"]
  }
]

3. Printer Configuration

  • Ensure your thermal printer is set as the default or specified in printer.py (modify printer_name = "58M Thermal Printer").
  • For Linux, install CUPS and update printer.py to use python-escpos or cups libraries.

4. Run the Application

# Start web interface (http://localhost:5000)
python app.py
# Run scheduler manually
python scheduler.py

5. Automated Startup (Windows)

  • Web Interface:
    1. Open Task Scheduler → Create Basic Task.
    2. Trigger: "At log on".
    3. Action: Start run_taskreaper.bat.
  • Scheduler:
    1. Open Task Scheduler → Create Basic Task.
    2. Trigger: "At startup".
    3. Action: Start run_scheduler.bat.

6. System Tray Controls

Right-click the Task Reaper tray icon (Windows):

  • Open Task Reaper: Opens web interface in browser.
  • Exit: Shuts down the app.

▶️ Usage

  • Web Interface: Visit http://localhost:5000 to submit tasks with a title, subtasks (comma-separated), and notes. Tasks print automatically.
  • Scheduler: Run scheduler.py to print daily tasks or weekly tasks (on Fridays).
  • Task Format: Tasks are printed with a ticket number, date, title, subtasks, and notes.

⚙️ Configuration

  • Task Files: tasks.json (web tasks), auto_daily.json (daily), auto_weekly.json (weekly).
  • Ticket Counter: ticket_counter.json resets daily.
  • Scheduler History: last_run.json tracks last print times.
  • Print Format: Customize in printer.py (format_task function).

🔧 Portability

  • Windows to Windows: Copy folder, update .bat file paths, reconfigure Task Scheduler.
  • Windows to Linux:
    • Convert .bat to .sh scripts.
    • Replace Task Scheduler with cron or systemd.
    • Update printer.py to use CUPS or python-escpos.

🐛 Troubleshooting

  • Printer Not Found: Verify printer name in printer.py and ensure it’s connected.
  • JSON Errors: Validate JSON syntax in task files.
  • Web Interface Inaccessible: Check firewall settings for port 5000.
  • Scheduler Issues: Ensure Task Scheduler or cron jobs are configured correctly.

Task JSON Structure:

{
  "title": "Task name",
  "subtasks": ["subtask1", "subtask2"],
  "notes": "Additional information",
  "print_now": true
}

🤝 Contributing

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature-name).
  3. Commit changes (git commit -m 'Add feature').
  4. Push to the branch (git push origin feature-name).
  5. Open a pull request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🏆 Credits

Made by C.M. - Braila, 2025

Acknowledgments

  • Flask team for the web framework.
  • pystray for system tray integration.
  • Python community for thermal printer libraries.

🔮 Future Enhancements

  • Mobile app interface.
  • Cloud sync for tasks.
  • Support for multiple printers.
  • Advanced scheduling options.
  • Task statistics and reporting.

Happy Reaping!

 |\---/|
 | o_o |
  \_^_/

About

Glorified vibe coded to-do app for printing tickets using a thermal receipt printer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published