-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamples.py
More file actions
51 lines (40 loc) · 1.73 KB
/
examples.py
File metadata and controls
51 lines (40 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""Some examples of how to use modules."""
# from everpy_extras import EverPyExtras
from everpy_pro import EverPyPro
import everpy_utilities
PATH_TO_ENSCRIPT = r"C:\Program Files (x86)\Evernote\Evernote\ENScript.exe"
def createnote(epy):
"""Example of how to make a note from python."""
content = open("README.md", "r").read()
notebook = "_INBOX"
title = "Everpy Generated Note"
tags = ["everpy"]
attachments = ["README.md"]
epy.create_note_from_content(content, notebook_name=notebook, title=title, tags=tags, file_attachments=attachments)
def main():
"""Example usages."""
dev_token = everpy_utilities.get_token()
try:
my_evernote = EverPyPro(dev_token, PATH_TO_ENSCRIPT)
except:
everpy_utilities.refresh_token()
my_evernote = EverPyPro(dev_token, PATH_TO_ENSCRIPT)
# Find and replace
# my_evernote.find_and_replace("evernote", "Evernote", "any:")
# Creating a note.
# createnote(my_evernote)
# Opening client with specific search attributes
# my_evernote.get_notes_to_manage()
# or
# my_evernote.search_notes("stack:Work intitle:\"new employee\"")
# Creating a note from an hmtl template
# my_evernote.create_note(open("Templates/testnote.html", "r").read(), title="testnote", notebook="_INBOX", tags=["everpy"], attachments=["Templates/testnote.html"])
##############################
# VVVV Tests may not work VVVV.
# my_evernote.create_template("Templates/simple_sections.txt")
my_evernote.create_template("Templates/card_template.txt")
# my_evernote.create_textnote_from_file("template.html", notebook_name="_INBOX")
# my_evernote.learn_notebooks()
# print(my_evernote.note_book_dict)
if __name__ == '__main__':
main()