Simon Willison’s Weblog

Subscribe

Friday, 14th June 2019

Convert Locations.kml (pulled from an iPhone backup) to SQLite. I’ve been playing around with data from my iPhone using the iPhone Backup Extractor app and one of the things it exports for you is a Locations.kml file full of location history data. I wrote a tiny script using Python’s ElementTree XMLPullParser to efficiently iterate through the Placemarks and yield them as dictionaries, which I then batch-inserted into sqlite-utils to create a SQLite database.

# 12:45 am / kml, projects, sqlite, xml, sqlite-utils

2019 » June

MTWTFSS
     12
3456789
10111213141516
17181920212223
24252627282930