Skip to content

Instantly share code, notes, and snippets.

@Blakeinstein
Created January 11, 2023 19:50
Show Gist options
  • Save Blakeinstein/0cdf4a17ad3dc2e440e8dd389f5f7aba to your computer and use it in GitHub Desktop.
Save Blakeinstein/0cdf4a17ad3dc2e440e8dd389f5f7aba to your computer and use it in GitHub Desktop.
Move Microsoft EDGE collections to raindrop / csv

Move Microsoft edge collections to services like Raindrop (that can accept csv)

Get the sqlite db file

  1. You can find the db file in the following places
  • Windows: %LocalAppData%\Microsoft\Edge\User Data\Default\Collections
  • MacOS: ~/Library/Application Support/Microsoft Edge/Default/Collections
  • Linux: TBD
  1. Copy the files (esp. collectionsSQLite) to a seperate Folder.

Execute the script

  1. Install python 3.10 and then setup pandas via pip pip install pandas
  2. save collections_to_csv.py to the same folder with the db files from the previous step.
  3. Exec the script python collections_to_csv.py

Then you can simply import the file normally to raindrop.

import json
import sqlite3
import pandas as pd
con = sqlite3.connect("./collectionsSQLite")
cur = con.cursor()
df = pd.read_sql_query(
"""
SELECT i.title as title, c.title as folder, i.source as data, i.date_created as created
FROM collections as c, items as i, collections_items_relationship as r
WHERE r.item_id == i.id and r.parent_id == c.id
""",
con
)
def blob_to_json(col):
my_json = col.decode('utf8')
d = json.loads(my_json)
return d["url"]
df["description"] = ""
df["tags"] = ""
df["created"] = df["created"].astype(int)
df["url"] = df["data"].apply(blob_to_json)
df.to_csv(
"out.csv",
index=False,
columns=["url", "folder", "title", "description", "tags", "created"]
)
@Kamek437
Copy link

Kamek437 commented Sep 21, 2023

If you polished this up a bit and did a Medium article or something I bet you you'd get a ton of views man.

@jbrown1597
Copy link

Jesus, THANK YOU.

Microsoft is so frustrating sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment