I have created an add-on that outputs a csv file with the ratings of anki cards and the time they were rated.
In the anki-review_results folder, I stored an empty init.py, anki_rating_time_record.py, and a file named manifest.json, and after compressing it, I converted the extension to .ankiaddon.
However, I got the following error
An error occurred during the installation of anki-review-results.ankiaddon: Invalid add-on manifest.
Please report this to the add-on author in question.
Anki_rating_time_record.py is as follows
import anki_python_api
import csv
import datetime
reset anki api
Anki = anki_python_api.
review_results =
def review_did_answer_card(result, card, ease):
now = datetime.datetime.now()
review_results.append((result, card, ease, now))
register Anki API
anki.add_review_did_answer_card_callback(review_did_answer_card)
start anki
anki.run()
save the results on csv format
with open(“review_results.csv”, “w”) as f:
writer = csv.writer(f)
writer.writer([“timestamp”, “result”, “card”, “ease”])
for all_results in review_results:
writer.writer([all_result[0].strftime(“%Y-%m-%d %H:%M:%S”),all_result[1],
all_result[2],all_result[3]])
The manifest.json is as follows.
{
“id” : “anki-review-results”,
“version”: “0.1”,
“name”: “Anki Review Results”,
“description”: “Save the results of your Anki reviews in a CSV file”,
“author”: “Shohei”,
“addonType”:[“background”],
“minimumAnkiVersion”: “2.1.0”
“files”:[“Anki_rating_time_record.py”,“init.py”]
}
The version of anki in use is 2.1.58.
What can I do to make it function properly? Please let me know.