Package: py-anki
"Ø§Ø¹ÙˆØ° Ø¨Ø§Ù„Ù„Ù‡ Ù…Ù† Ø§Ù„Ø´ÛŒØ·Ø§Ù† Ø§Ù„Ø±Ø¬ÛŒÙ…""I seek refuge in Allah from shaitan, the accursed one.""Ø¨Ø³Ù… Ø§Ù„Ù„Ù‡ Ø§Ù„Ø±Ø­Ù…Ù† Ø§Ù„Ø±Ø­ÙŠÙ…""In the name of Allah, the Most Gracious, the Most Merciful.""Ø¥ÙŠØ§Ùƒ Ù†Ø¹Ø¨Ø¯ Ùˆ Ø¥ÙŠØ§Ùƒ Ù†Ø³ØªØ¹ÙŠÙ†""It is You we worship and You we ask for help."- Al Fatihah : 05Py-AnkiPackage Name--->Py-AnkiPackage Description---> A simple API for Anki Spaced RepetitionPackage URL--->https://pypi.org/project/py-anki/#filesDeveloped By--->#arman_bhaai(either click on this hashtag or make a google search to discover more about my works)My Personal Portfolio--->https://arman-bhaai.github.io(some of my great projects are listed on my portfolio, so make sure you went through this)Find Me on Github--->https://github.com/arman-bhaaiFind Me on Facebook--->fb.me/arman.bhaaiAboutPy-Anki is an unofficial python binding/wrapper forAnkiConnectRESTful API. You can control all your Anki actions (eg: Create Deck, Add Notes, Get Card Info) using this package, in a more pythonic way.DocumentationWarning : This package is under development yet.Steps to use the APIFirst of all you need to installAnkiConnectaddon on your Anki Software.Then, run Anki Software and switch to your desired profile.Now run the example codes mentioned below...ExamplesCreate Deck# import api class from py-anki packagefrompy_ankiimportAnkiApi# create an instance of the api classanki=AnkiApi()# store deck creation querydeck=anki.create_deck('New Deck')# execute the queryanki.exec(deck)Expected Result :Create Model / Note Type# import api class from py-anki packagefrompy_ankiimportAnkiApi# create an instance of the api classanki=AnkiApi()# store model creation querymodel=anki.create_model('New Model')# execute the queryanki.exec(model)Expected Result :Create Single Note# import api class from py-anki packagefrompy_ankiimportAnkiApi# create an instance of the api classanki=AnkiApi()# populate note fieldsfield1='What is your name?'# for Front fieldfield2='arman_bhaai'note_fields=[field1,field2]# store note creation querynote=anki.create_note(note_fields,deck_name='New Deck',model_name='New Model')# execute the queryanki.exec(note)Expected Result :Create Multiple Notes with Media# import api class from py-anki packagefrompy_ankiimportAnkiApi# create an instance of the api classanki=AnkiApi()# store picture from the web for Note 1note1_picture=anki.fetch_picture(url='https://images.all-free-download.com/images/graphiclarge/beautiful_flower_series_04_hd_pictures_166886.jpg',filename='flower_jasmin.jpg',fields=['Front, Back'])# store audio from the web for Note 1note1_audio1=anki.fetch_audio(url='https://lex-audio.useremarkable.com/mp3/jasmine_us_1.mp3',filename='pronunc_jasmine.mp3',fields=['Back'])# store another audio from the web for Note 1note1_audio2=anki.fetch_picture(url='https://lex-audio.useremarkable.com/mp3/flower_us_1.mp3',filename='pronounc_flower.mp3',fields=['Back'])note1=anki.create_note(field_vals=['What is the name of this flower?','Jasmine'],deck_name='Default',model_name='Basic',audios=[note1_audio1,note1_audio2],pictures=[note1_picture],making_note_list=True)# store picture from the web for Note 2note2_picture=anki.fetch_picture(url='https://upload.wikimedia.org/wikipedia/commons/a/a6/Green_dome%2C_Masjid_e_Nabawi%2C_Medina%2C_KSA.jpg',filename='masjid-e-nawawi.jpg',fields=['Front'])# store audio from the web for Note 2note2_audio1=anki.fetch_audio(url='https://lex-audio.useremarkable.com/mp3/medina_1_us_2.mp3',filename='pronunc_medina.mp3',fields=['Back'])# store note with populated fields and medianote2=anki.create_note(field_vals=['Masjid e Nawawi is located in?','Medina'],deck_name='Default',model_name='Basic',audios=[note2_audio1],pictures=[note2_picture],making_note_list=True)# store list of notesnotes=anki.create_notes([note1,note2])# execute the queryanki.exec(notes)Expected Result :Class Reference(More to be added later...)### Class (* -> required)AnkiApi(host:str,port:str)### Attributes (Public)host:strport:str### Methods (Public)create_model(*model_name:str,*in_order_model_fields:list,card_name:str,model_css:str,template_front:str,template_back:str)->dictcreate_deck(*deck_name:str)->dictfetch_picture(*url:str,*filename:str,fields:list)->dictfetch_audio(*url:str,*filename:str,fields:list)->dictcreate_note(*field_vals:list,deck_name:str,model_name:str,allow_duplicate:bool,tags:list,audios:list,making_note_list:bool)->dictcreate_notes(*notes:list)->dictexec(req_query:dict)->json_obj### Methods (Private)_find_model_fields_by_name(*model_name:str)->list_catch_error(*json_resp:json_obj)