Skip to content

Instantly share code, notes, and snippets.

@PatonLewis
Last active October 17, 2020 23:46
Show Gist options
  • Save PatonLewis/c97173bdb6d82c5d1449fd1a6d42472b to your computer and use it in GitHub Desktop.
Save PatonLewis/c97173bdb6d82c5d1449fd1a6d42472b to your computer and use it in GitHub Desktop.
Convert Toodledo CSV file to Todoist CSV format
#!/usr/bin/python3
import csv
skipRow = True
with open( 'toodledo_current.csv', newline = '' ) as inFile:
reader = csv.reader( inFile )
with open( 'todoist_import.csv', 'w', newline = '' ) as outFile:
writer = csv.writer( outFile )
writer.writerow( [ "TYPE", "CONTENT", "PRIORITY", "INDENT", "AUTHOR", "RESPONSIBLE", "DATE", "DATE_LANG", "TIMEZONE" ] )
for inRow in reader:
if skipRow:
skipRow = False
else:
priority = 4 - int( inRow[ 12 ] ) if inRow[ 12 ] else 0
if inRow[ 9 ]:
dueDate = inRow[ 9 ] + " starting " + inRow[ 7 ]
else:
dueDate = inRow[ 7 ]
outRow = [ "task", inRow[ 0 ], priority, 1, None, None, dueDate, "en", None ]
writer.writerow( outRow )
if inRow[ -1 ]:
outRow = [ "note", inRow[ -1 ] ] + [ None ] * 7
writer.writerow( outRow )
@PatonLewis
Copy link
Author

There is currently a bug with the Todoist importer whereby it will not properly parse recurring dates for items. Although it appears to do so correctly, a recurring item will disappear once you check it off. To work around this bug, you have to open each recurring item in a client (web client for sure, maybe others), edit the text for the date (just add a space to the end of the text, for example), and then the client will do whatever extra step the importer is missing, and your recurring task will now be rescheduled correctly after you check it off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment