Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Todoist Task Printer

This project fetches tasks from Todoist, formats them using Claude AI, and sends the formatted output to a thermal printer via PrinterBot.

How It Works

  1. Environment Setup:

    • The script uses environment variables for API tokens and printer shortcode.
    • Required variables: TODOIST_API_TOKEN, CLAUDE_API_KEY, PRINTER_SHORTCODE
  2. Fetching Data from Todoist:

    • Retrieves projects and tasks from Todoist API.
    • Filters tasks based on priority (2, 3, or 4) and completion status.
  3. Organizing Tasks:

    • Groups tasks by project.
    • Sorts tasks within each project by priority (highest first).
  4. Formatting with Claude AI:

    • Sends the organized task list to Claude AI.
    • Claude formats the tasks into a JSON structure suitable for printing.
  5. Printing via PrinterBot:

    • Sends the formatted JSON to PrinterBot's webhook.
    • PrinterBot processes the JSON and prints the tasks.

Requirements

Setup

  1. Install required packages:

    pip install requests python-dotenv anthropic
    
  2. Create a .env file in the project root with the following:

    TODOIST_API_TOKEN=your_todoist_token
    CLAUDE_API_KEY=your_claude_api_key
    PRINTER_SHORTCODE=your_printerbot_shortcode
    
  3. Set up the hardware:

  4. Set up the Raspberry Pi:

    • After imaging the Raspberry Pi, plug it in and wait 5-6 minutes for the PrinterBot WiFi to appear.
    • Connect to the PrinterBot WiFi using the password "password".
    • Input your home network WiFi information.
    • Provide your email address (required to obtain your printer shortcode).
    • Wait for the setup process to complete and note down your printer shortcode.
  5. Run the script:

    python main.py
    

Output

The script will print status messages to the console, including Claude's formatted response and any errors encountered during execution.

Note

Ensure you have active accounts and valid API keys for Todoist, Anthropic (Claude), and PrinterBot before running the script.

About

Integrate a Raspberry Pi with a thermal printer to automate task printing from Todoist. A flexible starting point for various thermal printing projects, featuring API integrations, AI formatting, and PrinterBot output.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages