Quick way to get a copy of phpfina data for use in other programs?

I'd like to get a copy of the data from my emonpi to my desktop for use in other programs. I'd prefer to be able to do it from a command line, not through a browser. It is easy to scp the phpfina data, but then how to convert to CSV on the desktop? Or is there a command to get the data from the pi in CSV format directly?

I'm probably missing something obvious but didn't see this answered anywhere.