UPDATE [2012-12-10]: I’ve updated the script with the new login URL shown in the comment below.
UPDATE [2012-12-10]: I’ve added a new “–import” option to the script for importing a text file listing to-do items into a project.
UPDATE [2012-12-10]: I’m not using Todoist anymore. I’ve switched to Toodledo, which I’m much happier with. You should check them out!
I keep both work and personal to-do lists in Todoist, to which I refer frequently on a daily basis. This past weekend, Todoist was down for something like 12 hours; from what I subsequently read online, it’s not the first time it has gone down.
I can cope without access to my to-do lists for 12 hours, but what scared me about this outage was the realization that my to-do lists are only in Todoist. If it were to suddenly go away for a more than a day, or if (horror or horrors!) they suddenly went down forever, all my data would be lost. That’s not OK.
Many other people have this same concern and have begged Todoist to provide a mechanism for exporting their data to back it up somewhere. Thus far, the closest they’ve come to this is supporting offline use in their iPhone / iPod / iPad app, which is better than nothing, but not good enough.
So I wrote my own. It’s a Perl script you can download here. Here’s the documentation:
todoist-fetch.pl – Simple todoist backup / restore script, to reassure you that you won’t lose all of your data if Todoist suddenly goes belly-up.
todoist-fetch.pl [–help] [–manual] [–project=project] [–username=username] [–password=password] –text | –reorder [input-file] | –import [input-file] | –backup [–nocompleted]
This script has four modes:
- –text — Fetch all of the items in a specific project and print them one per line, including the item ID and content for each item.
- –reorder — Read a list in the format produced by –text and reorder the project so it matches the (presumably reordered) list.
- –import— Read a list of to-do items and import them into the specified project.Blank lines are ignored; all other lines are considered to-do items.Whitespace indentation in the input list causes indented to-do items.The use of tab indentation is discouraged, but if it is used, then tab stops are assumed to be eight spaces apart.Be consistent in indentation or the results may be confusing.
- –backup — Fetch all of your project and item data (not notes or labels, since I don’t use them, but patches are welcome and print them in JSON format with some text annotations explaining what the various JSON blobs are.
The format of the backup mode output isn’t intended to be particularly user-friendly, or easy to read, or easy to import into another application. If/when you need to do anything real with the data, you’ll probably need to write another script to convert it into something useful. All it’s intended to do is snapshot your data so you’ll have it in an emergency.
Backup mode uses a non-public API call, because the public API doesn’t allow all completed tasks to be fetched except for premium users, and I’m not a premium user. If the folks at todoist change the non-public API, this will break.
Other options in addition to the mode options described above:
- –help Print usage message and exit.
- –manual Print entire manual and exit.
- –username (or set $TODOIST_USERNAME) Specify Todoist username.
- –password (or set $TODOIST_PASSWORD) Specify Todoist password.
- –project (or set $TODOIST_PROJECT) Specify Todoist password for –text, –reorder, or –import.
- –nocompleted Don’t export completed items in backup.
Jonathan Kamens <email@example.com>.
Please feel free to contact me with questions, comments, or suggestions!
Also, please consider making a donation at http://blog.kamens.us/support-my-blog/ to support future development of this and other free tools.
Copyright (C) 2012 Jonathan Kamens. Released under the terms of the GNU General Public License, Version 3 or any subsequent version at your discretion. See http://www.gnu.org/copyleft/gpl.html.
$Id: todoist-fetch.pl,v 1.8 2012/12/10 16:10:26 jik Exp $