Skip to content

Instantly share code, notes, and snippets.

@symroe
Created July 11, 2013 08:39
Show Gist options
  • Save symroe/5973671 to your computer and use it in GitHub Desktop.
Save symroe/5973671 to your computer and use it in GitHub Desktop.
"""
Converts google latitude backup json files to CSV files.
Usage:
python convert.py < latitude.json > latitude.csv
"""
import sys
import json
import csv
field_names = [
'kind',
'altitude',
'longitude',
'latitude',
'accuracy',
'speed',
'timestampMs']
i = json.loads(sys.stdin.read())
out = csv.DictWriter(sys.stdout, field_names)
for location in i['data']['items']:
out.writerow(location)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment