timelog2csv Module

timelog2csv - converts a TimeLog calendar to a CSV file

TimeLog was a time tracking application for OS X. It stored it’s data using iCal. OS X Mountain Lion (and Mavericks) dropped some features that TimeLog needed to talk to iCal. So it’s impossible to access the recorded data because the application won’t even start.

But this small tool can help: Export the iCal calendar which you used to store TimeLog’s data. Then use timelog2csv to convert it to a CSV file.

Usage:
timelog2csv [-h] [–project=<name> ...] <ical> <csv> timelog2csv –version
Options:
-h –help Show this help
--version Show version
--project=<name>
 Filter by project name
class timelog2csv.UnicodeWriter(f, dialect=<class csv.excel at 0x22a4f58>, encoding=u'utf-8', **kwds)[source]

A CSV writer which will write rows to CSV file “f”.

File “f” is encoded in the given encoding.

writerow(row)[source]

Writes the row parameter to the writer’s file object.

writerows(rows)[source]

Writes all the rows parameters to the writer’s file object.

timelog2csv.check_source(filename)[source]

Checks if the source file exists.

timelog2csv.check_target(filename)[source]

Checks if the target file exists.

If the target file exists a confirmation to overwrite is required.

timelog2csv.get_row(component)[source]

Returns a row created from a VEVENT component.

A row is a list consisting of eight elements:

  • client
  • project
  • category
  • description
  • start
  • end
  • duration
  • status
timelog2csv.main()[source]

Runs the main program.

timelog2csv.parse_url(url)[source]

Parses url into six components, returns components and query string.

All query string key/value pairs are unquoted.

timelog2csv.read_data(ical_in, projects=None)[source]

Reads the data from the iCal file, returns a list of rows.

The optional argument projects can be used to filter the rows by project name.

timelog2csv.write_csv(csv_out, data, header=None)[source]

Writes data to a CSV file.

The header argument can be used to add a header row.