Skip to content

Instantly share code, notes, and snippets.

@sshh12
Created November 14, 2020 02:26
Show Gist options
  • Save sshh12/31a1db8d09dd56ab7dec1f9dcc80238f to your computer and use it in GitHub Desktop.
Save sshh12/31a1db8d09dd56ab7dec1f9dcc80238f to your computer and use it in GitHub Desktop.
"""
Use this script to migrate notes from Samsung Notes to Google Keep.
1. Export notes from Samsung Notes as .pdf files
2. Copy those into the same folder as this script.
3. Open Google Keep in your browser
4. $ python samsungnotes2keep.py
You may need to ($ pip install keyboard pdfplumber)
"""
import pdfplumber
import keyboard
import glob
import time
def main():
transfer = set()
for i, doc in enumerate(glob.iglob("Notes_*.pdf")):
with pdfplumber.open(doc) as pdf:
text = ""
for page in pdf.pages:
page_text = page.extract_text()
if page_text is not None:
text += page_text + "\n"
transfer.add(text.strip())
print('\nPlace your cursor in Google Keep (click "Take a note...") and press backspace.')
keyboard.wait("backspace")
for text in transfer:
keyboard.write(text)
keyboard.press_and_release("ctrl+enter")
time.sleep(2)
if __name__ == "__main__":
main()
@yossigrosskopf
Copy link

It looks very promising but it didn't add the notes, the script ran fine, so I made sure the PDF started with "Notes_" but no luck.
For now I have shared each note manually to the text file and then right into google keep however it does not include anything other than text.(images etc..).
Would love to get this script working, any help would be apricated

@sshh12
Copy link
Author

sshh12 commented Feb 10, 2022

Hey @yossigrosskopf, this script was super quick and I pretty easy to break. It also doesn't handle anything other than raw text notes. I would manually recreate notes if possible rather than using this if you are having issues.

@yossigrosskopf
Copy link

I see, thanks for your comment and your work.
Was worth a shot

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