TimeTracker is an application loosely based on TimeKeeper, a Windows application used to track the time you spent on a task. Being a Linux user and not willing to install Wine, I decided to hack my own version.
Dependencies
TimeTracker only requires Python 2.4 (or superior -- it should work fine with Python 2.5).
Options
- --version: show program's version number and exit.
- -h, --help: show this help message and exit.
- --config-file=_CONFIG_: Configuration file to use.
- -n_FILE_, --new=_FILE_: Start a new TimeTracker data file.
- -t, --task: Start a new task.
- -c_CLIENT_, --client=_CLIENT_: Task client.
- -a_ACTIVITY_, --activity=_ACTIVITY_: Task activity.
- -r_REFERENCE_, --reference=_REFERENCE_: Task reference.
- -m_COMMENT_, --comment=_COMMENT_: Task comment.
- -l, --list: Print the task list.
- -s, --stop: Stop the current task.
- -f, --force: Force starting a new task when one is already running or update the stop time of an already stopped task.
- -v, --verbose: Show the parameters values.
- --summary=_SUMMARY_FIELDS_: Summary. You need to specify the fields that should appear in the summary. Valid values are "date", "client", "reference", "activity" and "comment". Each field must be separated by a comma (without any spaces between them.)
- --fix: Recalculate the elapsed time of every task and update the task file (in case you changed the data file yourself).
- --time=TIME: Time of start/stop (will use current time if not defined). Can be "yyyy/mm/dd hh:mm:ss", "yyyy/mm/dd hh:mm", "hh:mm:ss" or even "hh:mm". On stop, the date is ignored.
- --license: Print TimeTracker license.
How to use it
If you never used TimeKeeper, besides being lucky, you won't see use for most of those fields. But everything starts with a data file, specified in the --new option. To start a task in this file, use the --task option, specifying --client, --activity and --reference. You only have to specify those three values once; every call later will use the last used values for those fields. You can also specify a --comment for the task (note: this value is not saved, so you need to specify it every time.) Once you finish the task, stop the counter with the --stop option.
TimeTracker saves the TimeTracker data file, client, activity and reference on ~/.timetracker.ini. These data are used on further calls, so you don't have to worry about them. If you need to see these values, use the --verbose option.
The --list option
Here is a sample output (HTMLized; on the console it wouldn't display the borders) of the --list option:
| Date | Start time | End time | Duration | Client | Activity | Reference | Comment |
| 23/12/2005 | 13:07:54 | (3:05:20) | "" | Julio | Bug fixing | Big project | Bug #4567 |
| 23/12/2005 | 09:20:04 | 12:02:48 | 2:42:44 | Julio | Bug fixing | Big project | Bug #4566 |
| 22/12/2005 | 12:58:48 | 18:59:42 | 6:00:54 | Julio | Writting documentation | Small project | "" |
All tasks are displayed from the most recent to the oldest. The first tasks shows the duration with braces 'cause isn't closed it and it is displaying the elapsed time.
(Note: if you just check the data file, you'll see that it isn't much different than this)
The --summary option
The --summary gives you a summary of what you did. You can pass a list of fields to be summarized and the program will display a list of things using that fields, ordered. For example, --summary=date will display a summary of how many hours you worked each day; --summary=date,reference will display how many many hours your worked each day on each reference. The order is given the field order: --summary=date,reference will order things by date and then by reference; --summary=reference,date will order things by reference and then by date.
Valid field names are:
- date
- client
- reference
- activity
- comment