From 30d243790f0906fd7a2786d62960a94d3ce53b63 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 28 May 2016 23:23:14 -0700 Subject: [PATCH] Adding new APIs --- anki_connect.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/anki_connect.py b/anki_connect.py index fda5a2c..95fdd1c 100644 --- a/anki_connect.py +++ b/anki_connect.py @@ -306,6 +306,27 @@ class AnkiConnect: return self.anki.modelFieldNames(modelName) + def api_addNote(self, note): + return self.anki.addNote( + note['deckName'], + note['modelName'], + note['fields'], + note['tags'] + ) + + + def api_canAddNotes(self, notes): + results = [] + for note in notes: + results.append(self.anki.canAddNote( + note['deckName'], + note['modelName'], + note['fields'] + )) + + return results + + def api_features(self): features = {} for name in dir(self):