Skip to content

Instantly share code, notes, and snippets.

@git-shogg
git-shogg / Google_Timeline_Summary-Step_03.py
Created July 25, 2021 03:33
Google_Timeline_Summary-Step_03.py
###############################################################################
# 3. Get Data #
###############################################################################
json_file = "Location History.json"
data = json.load(open(json_file)) # Read the file
locations = data['locations']
@git-shogg
git-shogg / Google_Timeline_Summary-Step_02.py
Created July 25, 2021 03:32
Google_Timeline_Summary-Step_02.py
###############################################################################
# 2. User Inputs #
###############################################################################
start_year, start_month, start_day = 2021, 6, 30
end_year, end_month, end_day = 2021, 7, 25
point_of_interest = (-77.85, 166.64) # Latitude, Longitude
distance_from_point_of_interest = 0.1
aggregate_by = 'Day' # This can be 'Year', 'Month', 'Day', 'Hour', 'Second'
weekday_exceptions = ['Saturday','Sunday'] # A list of weekdays that should excluded.
@git-shogg
git-shogg / Google_Timeline_Summary-Step_01.py
Last active July 25, 2021 03:31
Google_Timeline_Summary-Medium_Steps
###############################################################################
# 1. Importing Libraries #
###############################################################################
import json
import datetime
import pandas as pd
from geopy import distance