Forked from sliceofbytes/txt-to-google-keep-notes.py
Created
December 14, 2019 20:21
-
-
Save gdemin/a6f81454cf9ff2256e1294d606a92070 to your computer and use it in GitHub Desktop.
Add Text Files as Google Keep Notes
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
#Import a directory of text files as google keep notes. | |
#Text Filename is used for the title of the note. | |
import gkeepapi, os | |
username = 'username@gmail.com' | |
password = 'your app password' | |
keep = gkeepapi.Keep() | |
success = keep.login(username,password) | |
dir_path = os.path.dirname(os.path.realpath(__file__)) | |
for fn in os.listdir(dir_path): | |
if os.path.isfile(fn) and fn.endswith('.txt'): | |
with open(fn, 'r') as mf: | |
data=mf.read() | |
keep.createNote(fn.replace('.txt',''), data) | |
keep.sync(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment