Skip to content

Commit 359ffec

Browse files
committed
merge chronological sorting and json-first date extraction
(now correctly) merging @StrayGuru contributions: chronological sorting (oldest notes first), accurate json timestamp extraction, archived notes support, and cli options for flexible source/output configuration
1 parent 4147727 commit 359ffec

File tree

3 files changed

+417
-543
lines changed

3 files changed

+417
-543
lines changed

README.md

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
This script converts your **Google Keep archive** into Evernote-compatible `.enex` files — with support for:
44

5+
- 📅 **Chronological sorting** (oldest notes first, based on JSON timestamps)
56
- 🖼 Embedded images (inline in note content)
67
- ☑️ Checklists (converted to Evernote-style todos)
78
- 📌 Pinned notes (tagged as `pinned`)
9+
- 📁 Archived notes (tagged as `archived`)
810
- 🏷 Labels → Tags
911
- 📅 Created/modified timestamps
1012
- 🧾 UTF-8/emoji compatibility
11-
- 📂 Output split into multiple `.enex` files (chunks of 100 notes)
13+
- 📂 Output split into multiple `.enex` files (configurable chunk size)
14+
- 🎯 Command-line interface with flexible options
1215

1316
Tested with:
1417
- 5,000+ notes
@@ -29,7 +32,7 @@ Tested with:
2932
👉 Copy **all of those files (flat)** into the `keep_source/` folder in this repo.
3033

3134
> Requires `beautifulsoup4`.
32-
> See [Troubleshooting](#troubleshooting) if you hit an import error.
35+
> See [Troubleshooting](#%EF%B8%8F-troubleshooting) if you hit an import error.
3336
3437
---
3538

@@ -40,26 +43,61 @@ Tested with:
4043
2. **Run the converter**:
4144

4245
```bash
46+
# Basic usage (uses default directories)
4347
python google-keep-to-evernote.py
48+
49+
# Or with custom options
50+
python google-keep-to-evernote.py -s my_keep_export -o my_output --size 200
4451
```
4552

4653
It will:
4754

48-
- Ask if you'd like to clear the output folder
55+
- Ask if you'd like to clear the output folder (or use `--clear-output` to skip the prompt)
4956
- Convert your notes to Evernote `.enex` format
57+
- **Sort notes chronologically** (oldest first in `output_001.enex`)
5058
- Embed images and todos
5159
- Split the result into multiple `output_###.enex` files in `evernote_output/`
5260
- Log skipped notes or failed images to `migration_log.txt`
5361

62+
### Command-Line Options
63+
64+
```bash
65+
python google-keep-to-evernote.py [OPTIONS]
66+
67+
Options:
68+
-s, --source DIR Source directory (default: keep_source)
69+
-o, --output DIR Output directory (default: evernote_output)
70+
--size N Notes per file (default: 100)
71+
--no-sort Don't sort chronologically
72+
--clear-output Clear output folder without prompting
73+
-h, --help Show help message
74+
```
75+
76+
**Examples:**
77+
78+
```bash
79+
# Use default settings
80+
python google-keep-to-evernote.py
81+
82+
# Custom directories and 200 notes per file
83+
python google-keep-to-evernote.py -s my_keep -o my_enex --size 200
84+
85+
# Keep original order (don't sort by date)
86+
python google-keep-to-evernote.py --no-sort
87+
88+
# Auto-clear output folder
89+
python google-keep-to-evernote.py --clear-output
90+
```
91+
5492
---
5593

5694
## 📁 Folder Structure
5795

5896
```
5997
.
60-
├── google-keep-to-evernote.py # ← the script
61-
├── keep_source/ # ← your Keep HTML/JSON/image files go here
62-
├── evernote_output/ # ← final ENEX files + log
98+
├── google-keep-to-evernote.py # ← the main script
99+
├── keep_source/ # ← your Keep HTML/JSON/image files go here
100+
├── evernote_output/ # ← final ENEX files + log
63101
```
64102

65103
---
@@ -69,14 +107,17 @@ It will:
69107
| Feature | Supported |
70108
|------------------------|-----------|
71109
| Note content | ✅
72-
| Timestamps | ✅
110+
| JSON-first timestamps | ✅
111+
| Chronological sorting | ✅
73112
| Tags / labels | ✅
74113
| Checklists | ✅
75114
| Embedded images | ✅
76115
| Pinned notes | ✅ (tagged)
116+
| Archived notes | ✅ (tagged)
77117
| Migration log | ✅
78118
| Evernote-ready `.enex` | ✅
79-
| Chunked output | ✅ (100 notes per file)
119+
| Configurable chunking | ✅
120+
| Command-line interface | ✅
80121

81122
---
82123

@@ -102,6 +143,13 @@ If you're using a virtual environment, make sure it’s activated before install
102143

103144
---
104145

146+
## 👥 Credits
147+
148+
- **Tal Tabakman** ([@tabakman](https://github.com/tabakman)) - Original creator
149+
- **StrayGuru** ([@StrayGuru](https://github.com/StrayGuru)) - Chronological sorting & JSON-first date extraction
150+
151+
---
152+
105153
## 📄 License
106154

107155
This project is licensed under the MIT License.

0 commit comments

Comments
 (0)