Guest User

Untitled

a guest
Feb 26th, 2018
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #Import a directory of text files as google keep notes.
  2. #Text Filename is used for the title of the note.
  3.  
  4. import gkeepapi, os
  5.  
  6. username = 'username@gmail.com'
  7. password = 'your app password'
  8.  
  9. keep = gkeepapi.Keep()
  10. success = keep.login(username,password)
  11. dir_path = os.path.dirname(os.path.realpath(__file__))
  12. for fn in os.listdir(dir_path):
  13. if os.path.isfile(fn) and fn.endswith('.txt'):
  14. with open(fn, 'r') as mf:
  15. data=mf.read()
  16. keep.createNote(fn.replace('.txt',''), data)
  17. keep.sync();
Add Comment
Please, Sign In to add comment