python wrapper for upcoming eepynotes api
| .gitignore | ||
| eepynotesapiwrapper.py | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
eepynotes-api-wrapper
make sure you have all the dependencies installed by running pip install -r requirements.txt
docs will be here when i uneep
Examples
Logging in and getting instance info
from eepynotesapiwrapper import EepyNotesAPI, Note
api = EepyNotesAPI("token", base_url="https://example.com") # Logging in
print(api.get_instance_info()) # Returns current instance info
Getting and uploading notes
note = api.get_note("id")
print(note) # Returns Note(name="name", content="contents", ...)
note_to_upload = Note("name", "contents") # Creates a Note object
print(api.upload_note(note_to_upload)) # Returns {"message": "Note created succesfully!", "noteid": ...}
# -----
print(api.upload_note({"name": ..., "content": ..., ...})) # Returns {"message": "Note created succesfully!", "noteid": ...}
Editting a note
note = api.get_note("id") # Returns Note(name="name", content="contents", ...)
note.content = ...
note.name = ...
print(api.update_note("id", note)) # Returns {"message": "Note edited successfully!"}
# -----
note = Note("new name", "new content", ...)
print(api.update_note("id", note)) # Returns {"message": "Note edited successfully!"}
# -----
print(api.update_note("id", {"name": ..., "content": ..., ...})) # Returns {"message": "Note edited successfully!"}
Deleting a note
print(api.delete_note("id")) # Returns {"message": "Note deleted successfully!"}
Note objects and dicts can be converted
notedict = {"name": "name", "content": "content", ...}
note_converted_from_dict = Note.from_dict(notedict)
print(note_converted_from_dict) # Returns Note(name="name", content="contents", ...)
noteobj = Note("name", "content")
note_converted_from_obj = noteobj.to_dict()
print(note_converted_from_obj) # Returns {"name": "name", "content": "content", ...}