![]() ![]() parse ( cache = False )) res = list ( merge_events ( * itrs )) If you don't want to cache the results but want to merge results from multiple takeouts, can do something custom by directly using the merge_events function: from google_takeout_rge import merge_events, TakeoutParser itrs = # list of iterators of google events for path in : # ignore errors tk = TakeoutParser ( path, error_policy = "drop" ) itrs. To cache and merge takeouts (maintains a single dependency on the paths you pass - so if you change the input paths, it does a full recompute) from google_rge import cached_merge_takeouts results = list ( cached_merge_takeouts ()) parse ()) # to parse with cachew cache cached = list ( tp. dispatch_map () # to parse without caching the results in ~/.cache/google_takeout_parser uncached = list ( tp. To parse one takeout: from google_takeout.path_dispatch import TakeoutParser tp = TakeoutParser ( "/full/path/to/Takeout-1599315526" ) # to check if files are all handled tp. ![]() 'Google Play Store' 'Location History' 'My Activity' 'YouTube and YouTube Music' Library UsageĪssuming you maintain an unpacked view, e.g. Moving /tmp/tmp07ua_0id/Takeout to /home/sean/data/google_takeout/Takeout-1634993897 titleUrl'Īlso contains a small utility command to help move/extract the google takeout: $ google_takeout_parser move -from ~/Downloads/takeout*.zip -to-dir ~/data/google_takeout -extractĮxtracting /home/sean/Downloads/takeout-20211023T070558Z-001.zip to /tmp/tmp07ua_0id | select(.type = "Activity") | select(.header = "YouTube") |. to filter YouTube links from your Activity: google_takeout_parser parse -a json -no-cache. Takeout-New -action summary -no-cache Counter ()Ĭan also dump the info to JSON e.g. To clear the cachew cache: google_takeout_parser cache_dir clearĪ few examples of parsing takeouts: $ google_takeout_parser -quiet parse ~/data/Unpacked_Takout -cache Offers a basic interface to list/clear the cache directory, and/or parse/merge a takeout and interact with it in a REPL: To install with pip, run: pip install google_takeout_parserĬan be access by either google_takeout_parser or python -m google_takeout_parser. Likes: YouTube and YouTube Music/playlists/likes.json.Live Chat Messages - YouTube and YouTube Music/my-live-chat-messages/*.html.Comments - YouTube and YouTube Music/my-comments/*.html.History - YouTube and YouTube Music/history/*.html|*.json.Location History Location History/Location History.json, Location History/Records.json.Semantic Location History Location History/Semantic Location History/*.Google Play Installs - Google Play Store/Installs.json.Chrome History - Chrome/BrowserHistory.json. ![]() Activity (from dozens of Google Services) - My Activity/*.html|*.json).This was extracted out of my HPI modules, which was in turn modified from the google files in karlicoss/HPI You can tell it to run it at specific intervals, but I personally haven't found that to be that reliable. The process for getting these isn't that great - you have to manually go to every few months, select what you want to export info for, and then it puts the zipped file into your google drive. In options, deselect music-library-songs, music-uploads and videos.To use, go to For Reference, once on that page, I hit Deselect All, then select: Since the Takeout slowly removes old events over time, I would recommend periodically (personally I do it once every few months) backing up your data, to not lose any old events and get data from new ones. That means this'll take a few minutes the first time parsing a takeout, but then only a few seconds every subsequent time. This can take a few minutes to parse depending on what you have in your Takeout (especially while using the old HTML format), so this uses cachew to cache the function result for each Takeout you may have. Unhandled files will warn, though feel free to PR a parser or create an issue if this doesn't parse some part you want. The Google Takeout is pretty particular, and the contents of the directory depend on what you select while exporting. This doesn't handle all cases, but I have yet to find a parser that does, so here is my attempt at parsing what I see as the most useful info from it. Parses data out of your Google Takeout (History, Activity, Youtube, Locations, etc.) merge multiple takeouts into unique events.caches individual takeout results behind cachew. ![]() parses both the Historical HTML and new JSON format for Google Takeouts. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |