CoconutBattery Exporter

CoconutBattery is a little tool for Mac OS X that shows the battery capacity for laptops, useful to see how far the battery degraded. There is a button to save a snapshot, but one can only look at these snapshots in a list view within the program. There is no meaningful export option.

The data is stored in a XML file a little buried in the user's library directory (~/Library/). The data points look like this:

<object type="SAVEDDATA" id="z102">
    <attribute name="date" type="string">2010-09-03</attribute>
    <attribute name="capacity" type="string">87 % (4742 mAh)</attribute>
</object>

Somebody asked whether there is a possibility to export them to CSV and I tried to write a little program that does this job.