Created
November 14, 2020 02:26
-
-
Save sshh12/31a1db8d09dd56ab7dec1f9dcc80238f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see, thanks for your comment and your work.
Was worth a shot