Skip to content

Commit 8fbb02f

Browse files
committed
Merge branch 'release/0.5.3' into main
2 parents 6890664 + f309bf7 commit 8fbb02f

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM debian:bullseye
2+
RUN apt update
3+
RUN apt install -y python-is-python3 python3-pip
4+
RUN apt-get install -y curl
5+
RUN apt-get install ca-certificates
6+
RUN curl -L -o tmp/keep-it-markdown-0.5.3.tar.gz https://github.com/djsudduth/keep-it-markdown/archive/refs/tags/0.5.3.tar.gz
7+
RUN tar -zxvf tmp/keep-it-markdown-0.5.3.tar.gz
8+
RUN pip install -r keep-it-markdown-0.5.3/requirements.txt
9+
RUN pip install requests==2.23.0
10+
RUN pip install gpsoauth==1.0.2
11+
RUN pip install keyrings.alt

README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Keep-it-markdown or KIM converts Google Keep notes to markdown using the unoffic
66
The overall goal is to utilize Google Keep as an easy way to capture raw notes on all devices or additionally using the browser plugin. Then, notes can be queried for export to markdown files directly into notetaking apps such as Obsidian, Logseq and/or Notion, or used directly with Typora.
77

88
## Installation
9-
Install assumes you have some familiarity with running scripts through a terminal or command line. KIM is a command line script that **requires Python 3.8 or greater** and utilizes the unofficial gkeepapi.
9+
Install assumes you have some familiarity with running scripts through a terminal or command line. KIM is a command line script that **requires Python 3.8 or greater** and utilizes the unofficial gkeepapi. (**If you have Python versions 3.10+ and have login issues you may need to review Advanced Docker Setup below**)
1010

1111
**NOTE: Be aware that 'unofficial' implies that Google could change the API at any time that might stop the script from working!**
1212

@@ -46,7 +46,7 @@ This script was written before the official Google Keep API was available. The G
4646
```
4747
If you entered your Google email and application password correctly, you should see a successful login with the statement -> "You've succesfully logged into Google Keep!"
4848

49-
**If this step keeps failing see 'Key Callouts' #9 below, or, if you are using Python 3.10 or greater and have issues with the login - see this note: https://github.com/djsudduth/keep-it-markdown/issues/72**
49+
**If this step keeps failing see 'Key Callouts' #9 below, or, if you are using Python 3.10 or greater and have issues with the login - see Advanced Docker Setup below or read this note: https://github.com/djsudduth/keep-it-markdown/issues/72**
5050

5151
## Usage
5252
Congrats! You can now run KIM. Simply start by running:
@@ -169,7 +169,27 @@ Note: skip -s and overwrite -o cannot be used at the same time
169169
6. All notes' exported text are appended by their create date, update date and URL link back to the original Keep note.
170170
7. Both standard PNG and JPEG image files are supported. However, not all image types or non-standard formats may export properly. Drawings in Keep should download as PNG files.
171171
8. Keep uses AAC format for audio recordings. When notes are downloaded the audio is saved as M4A files. It is not known if this format will work on all markdown applications.
172-
9. There seems to be login issues due to some of the authentication and security library changes with Google and Python. Be sure to upgrade the gkeepapi to the latest version (**'pip install gkeepapi'**). Also, take a look at this note -> https://github.com/djsudduth/keep-it-markdown/issues/72. If those steps don't work, find a Linux or Mac system and run **'python keep-test.py -t'** which will display the token with the -t flag. Copy and save this master token in a safe and secure place!!. You can then use that token in KIM with **'python kim.py -t <your-token>'** which will save it in your keystore.
172+
9. There seems to be login issues due to some of the authentication and security library changes with Google and Python. Take a look at this note -> https://github.com/djsudduth/keep-it-markdown/issues/72 or use the Advanced Docker Setup in the next section
173+
174+
## Advanced Docker Setup
175+
If you are having difficulty logging in to Google you can use Docker with the preconfigured OS and Python version to access KIM and save your exported notes (see alternative step 7 if you want to save the Keep token on your PC).
176+
177+
**Steps:**
178+
1) Install Docker on any PC (find the online instructions for your particular operating system)
179+
2) Startup Docker (or it will autostart on reboot depending on how you installed it)
180+
3) Go to the command line and run ``docker build -t kim .`` in the directory where you installed KIM (it will take about 5 min to create the image)
181+
4) Run the Docker image with ``docker run --mount type=bind,source=(your PC's KIM directory)/mdfiles,target=/keep-it-markdown-0.5.3/mdfiles -it kim`` (you will be automatically logged into the Docker image and your PC's directory will be mapped to the Docker image directory)
182+
5) Change the directory to Kim ``cd keep-it-markdown-0.5.3``
183+
6) Create a temporary app password on Google
184+
---
185+
7) For one time or sporatic use, run KIM per the instructions above (note that in Docker python3 is aliased to python) - your exported notes will be exported to your PC. NOTE, however, that running Docker this way will not save any passwords or exported notes when you exit and you may need to recreate Google app passwords each time you use KIM with Docker this way.(Exit the Docker image with ``exit``)
186+
---
187+
7) Alternatively, run ``python keep-test.py -t`` in the Docker image to log in and display the Keep token (keep token will **appear be very long** - almost 2 lines)
188+
8) Copy the token by highlighting the entire string and hitting enter
189+
9) Paste and save the token somewhere safe
190+
10) Exit the Docker image with ``exit``
191+
11) Now run KIM in your current OS with the -t switch once to save it in the keystore (``python kim.py -t <long token here>`` - you may need a new Google app password to do this)
192+
12) You can now run KIM on any PC (once you save the token) with Python v-3.8 or higher
173193

174194
## Obsidian Use
175195
Since KIM converts Google Keep notes to markdown, you can use some of the Obsidian text markdown features in your Keep notes as you're capturing information. For example, you can begin to cross-link notes in Keep by using the Wikilink double-brackets within a note like this [[Title of another Keep note]]. Then, when you convert your notes to the Obsidian vault they will be automatically linked. This will also work for block references and other markdown notation. Most markdown types in Keep notes should convert successfully even if Keep cannot render them. **Do not try to add markdown for links/URLs in Keep**. KIM will try to map link any of Keep's URLs to markdown format for you.
@@ -198,7 +218,7 @@ KIM tries to adhere to strict markdown to be as compatible as possible. No iss
198218
- [ ] Tie Keep notes to Notion links for cross-linking of md imports
199219
- [ ] Email notes to Keep
200220
- [ ] Roam imports
201-
- [ ] Docker version
221+
- [x] Docker version
202222

203223

204224
## Thank You
@@ -214,4 +234,8 @@ Added create and update dates of markdown files to imported notes
214234
## 0.5.2 Recent Changes
215235
Switched audio file extensions from AAC back to M4A
216236
Added Joplin exports -j flag to use front matter header
217-
Removed first dash on list notes exported to Logseq with -l switch
237+
Removed first dash on list notes exported to Logseq with -l switch
238+
239+
## 0.5.3 Recent Changes
240+
Docker image creation and use
241+
Removed captcha note in keep-test.py

keep-test.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def ui_login(keepapi, show_token):
5050

5151
def main(argv):
5252

53-
try:
5453

54+
try:
5555
show_token = False
5656
if len(argv) > 1:
5757
if argv[1] == "-t":
@@ -63,7 +63,15 @@ def main(argv):
6363

6464
except Exception as e:
6565
print (e)
66-
print ("Please start your browser and copy-paste this URL in the address bar: https://accounts.google.com/DisplayUnlockCaptcha - then, try logging in again.")
66+
print (
67+
"If you still have issues logging in then you may need " \
68+
+ "to try 1 of 5 possible solutions:\n \
69+
1) recreate the Google app password to make sure it is valid and try again\n \
70+
2) find an PC with an older version of an OS (Windows 10 or Debian 11) with Python v3.8 or 3.9\n \
71+
3) install pyenv to allow for multiple versions of Python - try with Python 3.9.x\n \
72+
4) create a virtual machine with VirtualBox or other virtualization software and install an older OS\n \
73+
5) install Docker and run the Docker image in Advanced Docker Setup in README"
74+
)
6775

6876

6977

0 commit comments

Comments
 (0)