This script is for Windows users who want to convert their Google Keep notes (exported in JSON format) into Markdown (.md) files, suitable for use in Obsidian. Importantly, the script preserves the original timestamps from Google Keep notes.
Please note that this script only converts text content and labels from Google Keep notes. Attachments such as images and audio files are not converted.
In Google Keep, notes can have labels associated with them. This script converts these labels into hashtags at the end of the Markdown file.
For example, if a Google Keep note has labels "work" and "programming", these would appear at the end of the Markdown note like this:
#work #programming
The main text content of the Google Keep note is preserved as the main body of the Markdown file.
If a Google Keep note has a title, the script uses this title (with any invalid filename characters removed) as the filename for the Markdown file. If the title is absent or too long, the script uses the first few characters of the note's content as the filename.
First, you need to download your Google Keep data:
- Visit Google Takeout: https://takeout.google.com/.
- Deselect all data types and then select only "Google Keep".
- Choose the file type (
.zip
) and delivery method according to your preference, and click "Create export". - Once the export is ready, download the zip file and extract it.
Your Google Keep export will contain both JSON and HTML files. You need to extract only the JSON files:
- Navigate to the extracted folder containing your Google Keep export.
- Use the search functionality in Windows and search for
.json
. - Select all the
.json
files that appear and move them to a new folder. This is your JSON input folder.
You need Python 3 and the pywin32
module installed. To install pywin32
, you can use the following command:
pip install pywin32
In the script, you need to set the following variables:
input_folder: The path to the folder containing your .json files. output_folder: The path to the folder where you want to send the converted Markdown files.
Now, you can run the script. Open PowerShell or Command Prompt, navigate to the directory containing the script, and run:
python gk-to-obs.py
Your Markdown files will be created in the output directory you specified, each with a filename based on the note's title or content, and with preserved creation and modification timestamps.