Plyn: Yet another textfile-and-scripts based ToDo system

Warning: this post is mostly for geeks/programmers who will never be fully satisfied by any planning system, ever.

Over the years I’ve tried different ways of handling my ToDo, planning and work logging. This is my Xth iteration. I wonder if anyone but a programmer could use this, but hey, programmers are a non negligible fraction of society (which I happen to be part of)!

I’ve long wanted to create a program which would do precisely what I want in terms of planning, but was always put off by the “*knocks head on wall* the GUI is so long to code!” aspect. Well to hell with the GUI!

Err, sooo… Plyn (ie. this system) is inspired by the todo.txt scripts of Gina Trapani (LifeHacker author). Basically it allows you to have a very simple yet powerful todo.txt file, and the file is meant to be read directly (in contrast to other programs which use databases only the program can read). The difference is that my version:

  1. is written in Python (in contrast to Bash for Gina’s todo.txt)
  2. allows for hierarchy, empty lines, comment lines, etc. in the file, so the file can really be structured and read by itself, and a good deal of everyday tasks can be done without ever using the scripts
  3. includes a work log aspect, ie. you can record how much time you spent on tasks to keep stats.
  4. includes time estimates, but for the moment it’s not very developed.

So I’d say it departs from the need to be simple, to be expandable and support other dimensions of planning&logging.

Google Code link for the project & code: http://plyn.googlecode.com

The todo.txt format is pretty simple. Here’s an example of content:

12 Elephant in refrigerator project ||| Yeah, I shouldn't try myself at humor.
	# Open refrigerator door
	# Put elephant in refrigerator
	# Close refrigerator door

	-- This line is just a comment

A few observations:

  • You see a task may be nested in another one (which you can see as a project), simply using tabs.
  • Each line begins either with an ID (number) or with #. The # is replaced by a proper ID by cleanchanges.py (more on this later).
  • The ID is followed by a title, then |||, which indicates the start of parameters/comments.
  • You can have blank lines, and comments lines (starting with –).

After the ‘|||’ characters, you can place different parameters. In more detail, the format of a line is:

(INDENT) ID TITLE ||| {PRIORITY} <MINUTES_DONE/MINUTES_TODO> [START_DATETIME-ENDDATE_TIME] COMMENTS

As you can see, many more options may be specified (see the “format.txt” file for detailed information about each of these parameters), and of course this can be expanded (it all relies on a huge regex). But everything following ||| is optional.

So you can edit the todo.txt file manually, but there are, of course, helper scripts to automate certain tasks. The one you’d use the most is today.py. It gives you a list of all high-priority tasks, late/coming up tasks, and tasks awaiting feedback (“+feedback” tag in title). By editing the script you could add whatever other list you need.

You can also, of course, filter tasks by text using grep. So you could have tags or contexts, for example, if you’re into GTD.

The cleanchanges.py script will replace the # at the beginning of the line by an ID which can then be used to refer to the ToDo item in other scripts. cleanchanges.py will also transform dates, so you can write:

-- Today is 2009/03/14
# Clean refrigerator ||| [-+15]

and the item will be changed into

15 Clean refrigerator ||| [-2009/03/29]

ie. the date can be specified as the number of days in the future, which saves finger mana.

The work log is also simple. To say you’ve just spent the last 3 hours cleaning the refrigerator, you would do:

./log.py 15 180 "Some comment to add to the log"

(where 15 is the task ID and 180 is 3 hours expressed in minutes). This will add a line to the log.txt file, and will change the MINUTES_DONE field of the item in todo.txt.

Scripts are meant to be called from a command line you keep open somewhere in the scripts directory, so you can use autocompletion. Path for todo.txt and other files are configured in cfg.py.

And, of course, the whole thing can be extended as you please. My ultimate goal is to have a script with which I can truly estimate the free time I have, ie. to determine if I can engage in a new task or not.

If anyone ever uses this, be sure to let me know! I’m especially interested in hearing of other must-script-the-procrastination-away coders who expand this thing in whichever direction their urges take them.

Leave a comment