Skip to content

Containerized application to sort Todoist items in a project based on their name to the last section that item was seen in. Main use case is sorting a shopping list.

Notifications You must be signed in to change notification settings

trevorswanson/todoistsorter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todoistsorter

CodeQL Pylint Build

Todoistsorter sorts (and capitalizes first letter) of tasks on a given Todoist task-list into sub-sections, based on where tasks with the same name were last found.

This is a near-complete rewrite of frostbox42/todoistsorter to use new Todoist APIs.

What does it do?

Todoistsorter has two methods of action:

Webhooks

  1. Receives incoming webhook from Todoist with a single item
  2. For added items: capitalized first letter (if not already done)
  3. For added items: check if exists in database of previously known items 4a. If item is previously known it is moved to the last known section 4b. If item is not known, item is left where it is
  4. For updated or completed items: stores which section they were in

Reconcile Loop

I've encountered situations where the Todoist webhooks simply don't come in, or they're very late. Therefore, todoistsorter can reconcile the full project on a recurring basis.

  1. Every SYNC_INTERVAL seconds, pull all active (not completed) tasks from your project
  2. Capitalize the first letter (if not already done)
  3. If the item is in a section, store that section in the database
  4. If the item is not in a section, move it to the last known section

Prerequisites

Container parameters

  • APITOKEN (required) - Private API-token, can be retrieved from the "Integration" part of the settings in the Todoist web-interface (see above)
  • PROJECT (required) - ID of the project the project to monitor, can be retrieved from the url of the project when accessed through web-browser (see above section)
  • SYNC_INTERVAL (optional) - How often to run a full reconcile
  • LOGGING (optional, default INFO) - What level of logging to use (CRITICAL, ERROR, WARNING, INFO, DEBUG)

Docker Compose

services:
  todoistsorter:
    image: ghcr.io/trevorswanson/todoistsorter:latest
    container_name: todoistsorter
    volumes:
      ./data:/app/data
    environment:
      - APITOKEN=**INSERT API-TOKEN HERE**
      - PROJECT=**INSERT PROJECT-ID HERE**
    ports:
      - 5005:5005
    restart: unless-stopped

Docker Run

docker run -p 5005:5005 --restart unless-stopped -e APITOKEN=**INSERT API-TOKEN HERE** -e PROJECT=**INSERT PROJECT-ID HERE** tswanson/todoistsorter

Built Using

  • Python v 3.13
  • Alpine Linux
  • Todoist API v1
  • SQLite3

Authors

About

Containerized application to sort Todoist items in a project based on their name to the last section that item was seen in. Main use case is sorting a shopping list.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Python 97.8%
  • Dockerfile 2.2%