Created
July 11, 2013 08:39
-
-
Save symroe/5973671 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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