Google Keep import/export CLI for markdown directories.
Project description
KeIO
A Python CLI for importing and exporting Google Keep notes to markdown directories.
KeIO stores sync metadata in an HTML comment footer at the bottom of each exported markdown file, enabling conflict detection and incremental syncing.
Fun fact: KeIO stands for "Keep I/O" 😊
Installation
pip install keio
Or with uv:
uv tool install keio
To use the gkeepapi backend (see Authentication below):
pip install "keio[gkeepapi]"
Authentication
KeIO supports two authentication backends. You must pick one; they cannot be mixed.
Option A: Enterprise (official Google Keep API)
[!WARNING] The official Google Keep API is only available to Google Workspace Enterprise users. It will not work with free
@gmail.comaccounts or non-Enterprise Workspace plans.
This backend uses the official REST API with a standard OAuth 2.0 Desktop App flow.
- Go to Google Cloud Console.
- Create or select a Google Cloud project.
- Search for "Google Keep API", open it, and click Enable.
- Search for "Google Auth platform" and open it.
- If no app exists yet, use the setup wizard to create one.
- Open Clients and create a Desktop app OAuth client (or download JSON from an existing one).
- Run setup and login:
keio auth setup --method enterprise --credentials /path/to/credentials.json
keio auth login
References:
Option B: gkeepapi (unofficial, any Google account)
[!WARNING] This backend uses the unofficial gkeepapi library, which reverse-engineers the mobile Google Keep protocol. It can break without notice if Google changes their internal API. Attachment download support is limited.
This backend works with any Google account, including free @gmail.com. Setup requires
obtaining a master token via a Docker one-liner.
Step 1 -- Get an OAuth token cookie:
- Open https://accounts.google.com/EmbeddedSetup in your browser.
- Log in with your Google account and click "I agree". (The page may show a loading screen indefinitely after this; that is expected.)
- Open browser developer tools -> Application -> Cookies.
- Copy the value of the
oauth_tokencookie.
Step 2 -- Get a master token (via Docker):
docker run --rm -it python:3 sh -c '
pip install -q gpsoauth && python3 -c "
import gpsoauth,secrets,json
e=input(\"Email: \")
t=input(\"OAuth token: \")
a=secrets.token_hex(8)
r=gpsoauth.exchange_token(e,t,a)
print(json.dumps({\"email\":e,\"master_token\":r[\"Token\"]}))"'
Step 3 -- Pass the JSON to keio:
You can pass the JSON output directly:
keio auth setup --method gkeepapi --credentials '{"email":"...","master_token":"..."}'
Or save it to a file first:
keio auth setup --method gkeepapi --credentials /path/to/token.json
Then verify:
keio auth login
References:
Other auth commands
keio auth status # Show current method and login state
keio auth logout # Remove cached tokens
Usage
Export
Export your Google Keep notes to a local directory:
keio export /path/to/notes
- Downloads note text, checklists, and attachments.
- Skips locally modified files unless
--forceis used. - Use
--dry-runto preview without writing.
Import
Import markdown files back to Google Keep:
keio import /path/to/notes
- Supports note text and checklist content.
- Uses footer metadata to detect stale local files and avoid conflicts.
- Skips notes whose remote version is newer unless
--forceis used. - Use
--dry-runto preview without creating or replacing notes.
Image upload (--images)
[!IMPORTANT] Neither the official Keep API nor gkeepapi supports uploading attachments programmatically. Export can download images, but import cannot upload them.
The --images flag provides a semi-automated workaround:
keio import /path/to/notes --images
For each note that has local attachments, --images will:
- Create or update the note text in Google Keep as usual.
- Open the note in your browser and the attachment folder in your file explorer.
- Poll the note for up to 5 minutes, waiting for you to drag-and-drop the images into Keep manually.
- Press Enter at any time to skip a note and move on.
This makes it practical to re-attach images in bulk without hunting for each note by hand.
Common flags
| Flag | Applies to | Description |
|---|---|---|
--dry-run |
export, import | Preview changes without writing |
--force |
export, import | Ignore conflict checks and overwrite |
--credentials PATH |
export, import | Override OAuth credentials file |
--images |
import | Assist with manual image upload (see above) |
Development
git clone https://github.com/soldni/keio.git
cd keio
uv sync --extra dev
uv run pytest
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keio-0.1.0.tar.gz.
File metadata
- Download URL: keio-0.1.0.tar.gz
- Upload date:
- Size: 871.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46303b13f42e10a933857e19ba33523126d34bbfe9efa7fecf803aaaa9921ed0
|
|
| MD5 |
010b2379be198c229ddbae124b74a683
|
|
| BLAKE2b-256 |
310073733a049fdcdb6bab6e90340c963ff3c16604e926b55825364af8a9dccd
|
Provenance
The following attestation bundles were made for keio-0.1.0.tar.gz:
Publisher:
publish.yml on soldni/keio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keio-0.1.0.tar.gz -
Subject digest:
46303b13f42e10a933857e19ba33523126d34bbfe9efa7fecf803aaaa9921ed0 - Sigstore transparency entry: 1196106278
- Sigstore integration time:
-
Permalink:
soldni/keio@781cb13d7f00bb45b3d20a9a52583d4902ec0b34 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/soldni
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@781cb13d7f00bb45b3d20a9a52583d4902ec0b34 -
Trigger Event:
release
-
Statement type:
File details
Details for the file keio-0.1.0-py3-none-any.whl.
File metadata
- Download URL: keio-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9c52b337e8f871a048447e520bc714ae5c52847f09bd1b684d7b0fbc24254af
|
|
| MD5 |
0e059b5ef8b0e51e713314e26e479184
|
|
| BLAKE2b-256 |
4e01b5494b7e7bf73d95e1016ef23f72febac109da12556da8dcbdf49c0b67f9
|
Provenance
The following attestation bundles were made for keio-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on soldni/keio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keio-0.1.0-py3-none-any.whl -
Subject digest:
e9c52b337e8f871a048447e520bc714ae5c52847f09bd1b684d7b0fbc24254af - Sigstore transparency entry: 1196106301
- Sigstore integration time:
-
Permalink:
soldni/keio@781cb13d7f00bb45b3d20a9a52583d4902ec0b34 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/soldni
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@781cb13d7f00bb45b3d20a9a52583d4902ec0b34 -
Trigger Event:
release
-
Statement type: