todoist-repeater

Create recurring tasks in Todoist with cron-style syntax
Log | Files | Refs | README

README.md (2380B)


      1 # Todoist Repeater
      2 
      3 ## Background
      4 
      5 I use Todoist as my todo app. I add tasks to my Inbox, sorted descending by date added. However, repeating tasks in Todoist don't work with my workflow: they stay in a fixed position in the list, and just refresh the due date.
      6 
      7 What I want is a task that appears on a given interval, disappears when it's completed, and, when it's time to do it again, reappears at the top of the list.
      8 
      9 Some examples of tasks that I want to recurr in this way:
     10 
     11 - each weekday, do a given number of Pomodoros for work
     12 - every day, practice my dance choreography for 15 minutes
     13 - every Monday evening, take out the garbage, recycling, and compost
     14 - every two weeks, wash my bedding
     15 - every six months, wash and condition the leather sofa
     16 - every three months, do a reflection on how I'm feeling about work
     17 
     18 ## Design
     19 
     20 The idea for this program is to:
     21 
     22 - have a list of tasks that specifies the task name and the recurrence (interval, start and end date)
     23 - when it's time to add a task to Todoist, use the Todoist API to create the task in my inbox
     24 
     25 Here's the API documentation: https://developer.todoist.com/api/v1/
     26 
     27 - I can probably get away with not implementing OAuth, and just using an access token
     28 - Creating tasks: https://developer.todoist.com/api/v1/#tag/Tasks/operation/create_task_api_v1_tasks_post (simple because pretty much all I want is the task name)
     29 
     30 The hard part is how to specify the input file and recurrence mechanism.
     31 
     32 There are some interesting considerations:
     33 
     34 - if we somehow weren't running when we should have created a task, should we do so later?
     35 - should we track when we created a task so we don't do it twice somehow?
     36 - how can we handle reloading the input file?
     37 - is DST dangerous?
     38 
     39 Seems like https://github.com/robfig/cron is the most popular scheduler, and it doesn't have any dependencies, which I like.
     40 
     41 So, here's what I have in mind:
     42 
     43 At program start, and every minute thereafter:
     44 
     45 - read the input file line by line
     46 - if we've seen a line before, do nothing
     47 - if we have not seen it, add the line to the hash of seen lines; then, add it to the scheduler
     48 - if there were any lines that we did not see during this read of the file, but that we saw previously, remove them from the scheduler
     49 
     50 The lines will be formatted like a cron file, but instead of a command, we will simply have the name of the task to be created.