#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(); |
This comment has been minimized.
This comment has been minimized.
Great! Thanks for this, saved me lots of time! |
This comment has been minimized.
This comment has been minimized.
Thanks for the script! On my Jupyter notebook on Windows I encountered the following problems:
Then, it did its job perfectly! |
This comment has been minimized.
This comment has been minimized.
Great stuff! I had problem importing filenames with special UTF characters yet script did the job. |
This comment has been minimized.
This comment has been minimized.
It did not upload all my files. What should I do? I have over 1000 notes I want moved over. It stopped about halfway. Thank you in advance. |
This comment has been minimized.
This comment has been minimized.
@onety-two check if your filenames are pure ASCII. I had trouble with polish letters and script had no error message for this. |
This comment has been minimized.
This comment has been minimized.
@onety-two I would just check which file it stopped at (add a print), likely it's an ascii / utf8 char issue. This was just a quick script for a friend. |
This comment has been minimized.
This comment has been minimized.
I am a complete newb.. i am just trying to take all of my txt notes on my windows machine and add them to google keep.. just moved over from mac to windows.. how and where do i add that code |
This comment has been minimized.
This comment has been minimized.
For me, it raises a login exception, if someone could help I'd be really thankful.
SOLUTION:
Thanks for the code, it helpt me import over 400 txt files. |
This comment has been minimized.
This comment has been minimized.
It did not work for me: |
This comment has been minimized.
This comment has been minimized.
@WiliTest same problem. does anyone able to authenticate with app password? |
This comment has been minimized.
This comment has been minimized.
Hello, Thank you for your script! It could be wery usefull because I have 400 text files to import but it does not work for me. |
This comment has been minimized.
This comment has been minimized.
I modify it a little so it could support my 800++ notes because Google have limit for notes per minute anyway thank you so much! |
This comment has been minimized.
Thanks for this, you saved me a lot of time :)