Jump to content

Search the Community

Showing results for tags 'anki'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Alfred 3
  • Make the Most of Alfred
    • Discussion & Help
    • Bug Reports
    • Alfred Feature Suggestions
    • Themes
  • Alfred Workflows
    • Submit your Workflows to Alfred Gallery
    • Share your Workflows
    • Workflow Help & Questions
    • Workflow Advanced Tips & Tricks
    • Workflow Automation Tasks
  • Alfred Themes
  • Alfred Remote for iOS
    • Alfred Remote Discussion & Help
    • Remote Connection Troubleshooting


  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Website URL




Found 6 results

  1. Ok. One more attempt to make the workflow for Anki cards generating. Or rather filling into Anki fields the content via Alfred. For me this way much handy than native Anki app. Obviously, it's not a full replacement for all cases. Something like Anki-Express. Anki: Powerful, intelligent flash cards. anki card generator: Create New Cards into any Decks with any "Note Type". Install $ npm install --global alfred-anki or as anki.alfredworkflow Requires: Node.js 7.6+, Alfred Powerpack, Anki intelligent flashcards, AnkiConnect plugin for Anki Usage In Alfred, type :anki, Enter/Click on the any field to fill it in Enter/Click to save current value the same staps to edit. type :anki!, to setting menu. This workflow uses Markdown syntax: markdow-it library with Syntax highlighting (highlighjs.org), <ins> tag plugin for markdown-it ++inserted++ => <ins>inserted</ins>, <mark> tag plugin for markdown-it ==marked== => <mark>inserted</mark> Emojies Shortcuts (emoticons): πŸ™‚ 😞 8-) <abbr> tag plugin for markdown-it : *[HTML]: Hyper Text Markup Language The HTML specification On the card fields: hit βŒƒ + ↩ to remember last input after created card. hit βŒƒ + ↩ one more time to toggle switch this option hit βŒ₯ + ↩ to reset text from all fields hit ⇧(shift) to preview parsed fields of the card for line break type '\n' (with space or without), also should be handy to use 'Alfred's snippets'. to add an image from clipboard use Alfred snippet >>img needs install pngpaste check out another Alfred's snippets To use your own icons for your Model's fields just you should call the png files the same as fields [name-of-field].png and put it into icons folder of this Workflow directory. Recommended use two instances of each icon where second icon (with some mark) will be called as [name-of-field]_marked.png for "remember last import" option. ToDo Add sound to the field. (needs something universal) Add to the card and move the local image file to the foldercollection.media via Alfred Snippet p.s. It would be great to hear some more feature ideas to improve workflows like this.
  2. Hi all, I'm trying to use snippets to insert symbols (up arrow, down arrow, etc.) into anki cards on a Mac. My goal is to be able to insert them when making Anki cards but I am clueless on where to begin. Can someone point me in the right direction on where to learn? Thanks!
  3. Alfred 3 workflow to a quick look at Longman dictionary and creating Anki cards (intelligent flashcards). The search, ldoce <query> for Longman Dictionary, uses Pearson's API to hunt for headwords and senses that match headword <query> The search, ldoce <query>, uses Pearson's API to hunt for headwords and senses that match headeword/<query>. 25 results are retrieved by default for headword search. This workflow searches from Longman Dictionary of Contemporary English (5th edition)[ldoce5 - API]. And creates Anki cards by your choices (if an article of the current word in this API not existing audio examples the Alfred will create audio examples from Oddcast. [uses random voices: Julie, Kate, James] I created the video presentation (duration 4 minutes) which explain it better. Look at this in action if you are interested. Install: $ npm install --global alfred-ldoce Download and import the deck example for Anki to install template for this grabbing from ldoce API. Requires: Node.js 4+, Alfred Powerpack, Anki intelligent flashcards, AnkiConnect plugin for Anki. Configuration There are two options: language: Choose your language (it use google-translate-API). path_to_anki-media: by default don't need to. The teaching method used in the Anki template: Scramble is a method of teaching by dividing a worksheet and answer sheet with alternative answers available. The students are expected to look for answers and the solution to a problem that exists. Scramble sentence - is a game to arrange random words to form a specific sentence. The sentence should be logical, meaningful, appropriate, and correct. For example: does – he- where – holidays – go – on? = Where does he go on holidays? went-i-school-to-yesterday = I went to school yesterday More info: Getting started with NPM install from npmjs.com github.com/bikeNik/alfred-ldoce
  4. My initial attempt at an Anki workflow. More to come after boards (have to put away addicting things such as Alfred ). I welcome any and all suggestions. Download, GitHub, Packal. Requirements: Alfred Anki Commands: :anki :aset :apath Anki Terminology: Collection = Group of Decks Notes = Collection of Facts Cards = Representation of Facts A note has a one to many relationship with cards, while a card can have only one associated note. Custom Dark Theme: Cards (notes) created from the workflow use this theme. Once the first card is created (from within workflow) the theme is available within Anki. The theme comes loaded with jQuery v1.11.2 and plugins Zoom, Magnific Popup, Panzoom (mobile only), and Noty. You can find it in Anki under Tools > Manage Note Types > Alfred Dark. If creating cards from inside Anki the theme has optional fields. Front, F NoteFront side, and optional note Back, B NoteBack side and optional note classThe theme default is to center all text. To adjust text to the left enter left in the class field. NotyShow an optional note on the back-side of the card. Good for reinforcement. httpEntering a URL in this field displays a link in the bottom right on the back-side. Accepts www.site.com without http video - Accepts youtube and vimeo urls. Link to the video is displayed in the upper left on the back-side. Workflow Progression: 1. :aset As of now contains two actionable items.Update collection (manual collection refresh) Set Anki collection path (redirects to :apath) :apathThe workflow looks for the Anki collection in the most typical locations. If the path is not found the user will be prompted to enter the path manually.The default directory is /Users/OSX_NAME/Documents/ANKI_USER/collection.anki2 The default ANKI_USER created when Anki is first run is User 1. If you have changed this, enter your Anki user name. If the path is found :apath is only useful if needing to switch between collections. 2. :anki Search the collection for a deckSearch by name, or deck id If the deck doesn’t exist you can create a new deck with the query as the title. Select deck Search for notes within selected deckSearch by facts, or tags If the card is not found you can create a basic, two-sided card (cloze additions on the to-do list). The theme is the custom dark theme described above. Select cardCurrently the only option after selecting a card is to modify its tags. tags are entered as #tag1 #tag2 #tag3 Credits: This workflow uses the python workflow library Alfred-Workflow (by deanishe). The internal structure borrows *heavily* from the FuzzyFolders and Reddit workflows (also by deanishe). The new_card.py was written by (guess who) deanishe, as a demo for my edification. TO-DO: Anki Sync File Action to import csv’s Sort decks by new, reviewing, missed More robust display of deck/card statistics Open Anki to a specific deck Choose model (theme) when adding cards Allow for cloze cards Rename decks
  5. I have a few questions regarding workflow structure, storage, and python how-to's. Anki is a flashcard program, it is written in python, and has a sqlite database. 1. In order to connect to the database I need to supply a path. Since I'm using the Anki module alone (without anki's version of PyQt, aqt), I have to supply the path manually. The way I'm doing this is rather costly, and I would like to "store" the path after a successful connection is made, so further instances of the workflow have access to and use this path. Below, I've covered the most likely paths to Anki, but at a later time I would like to ask the user, through Alfred, to input the path if an error occurs. As a point of style, is it customary to import a module within a def? def get_col(): default_locations = [ os.environ['HOME']+'/Anki/User 1/collection.anki2', os.environ['HOME']+'/.anki/User 1/collection.anki2', 'collection.anki2' ] for location in default_locations: if os.path.exists(location): return location else: import glob home_path = os.path.expanduser('~') pattern = (home_path + '/**' + '/Anki' + '/*' + '/collection.anki2') for path in glob.glob(pattern): return path 2. When a result is selected with Alfred, and passed to the next script as the query, how can I get the result of the second script to display in Alfred? The wf.add_item doesn't seem to do it. The script 2, at the end of the post, should display the card count. 3. Besides querying Anki's database, eventually I would like to add cards from Alfred. The flow of the workflow ideally would be to first select a deck, and then options and deck statistics would display below in the results area. One option would be to add a card to the selected deck. After choosing "Add Card" the user would type in the front side, and by some magic of python, the front side text would display as the first result, the input area would clear and allow for the backside to be entered, which would display as the second result before submitting the change. This is why I'm asking for suggestions for structure. Is there a best way to account for these options by structuring the workflow a particular way? Further down the road I could allow for changes to the front or back after the initial input so that mistakes on card entry could be corrected. And much further down, I could allow for images to be attached with Alfred's file action. I've been playing with Anki heavily, I've authored a addon, HTML 2 ANKI (repo), and generally feel confident to start merging what I've learned into an Alfred workflow. 4. Within the workflow I've supplied the Anki module, but to import the module I first have to append the path with sys.path.append, else I receive errors, or run the script from the Anki folder. I did make sure to include __init__.py in all subfolders, however, the Anki module's __init__.py is not empty, and this seems to be the source of my frustration. I won't need the module until I start adding cards with Alfred (Anki says that doing it through the database is not recommended, mentioning that when updating Anki issues may arise), but I wanted to know if appending the path is acceptable here. I'll be sitting for step1 this summer, so I'm just trying to form a plan at this point, but afterwards I'd like to get this going. Anki's popular for people learning new languages, and med students, so I'm hoping it will be of use for a few people. As always suggestions are most appreciated. Script 1: # -*- coding: utf-8 -*- # [Run from subdirectory] import os, sys #abspath = os.path.abspath(__file__) #dname = os.path.dirname(abspath) + '/main' #sys.path.append(dname) # [IMPORT] import re import sqlite3 import json #from anki import storage, stats #from BeautifulSoup import BeautifulSoup, Comment, NavigableString from workflow import Workflow log = None def get_col(): default_locations = [ os.environ['HOME']+'/Anki/User 1/collection.anki2', os.environ['HOME']+'/.anki/User 1/collection.anki2', 'collection.anki2' ] for location in default_locations: if os.path.exists(location): return location else: import glob home_path = os.path.expanduser('~') pattern = (home_path + '/**' + '/Anki' + '/*' + '/collection.anki2') for path in glob.glob(pattern): return path return None def db_decks(db): results =[] deck_db = db.execute("SELECT decks FROM col") decks = json.loads(deck_db.fetchone()[0]) for d in decks.items(): deck = {'title': None, 'id': None} deck['title'] = d[1]['name'] deck['id'] = d[0] log.debug(deck) if deck['id'] is None: continue results.append(deck) return results def key_for_deck(deck): return '{} {}'.format(deck['title'], deck['id']) def main(wf): query = None if len(wf.args): query = wf.args[0] apath = get_col() connection = sqlite3.connect(apath) decks = db_decks(connection) if query: decks = wf.filter(query, decks, key_for_deck) if not decks: wf.add_item('No items', icon=ICON_WARNING) for deck in decks: wf.add_item( title = deck['title'], subtitle = deck['id'], arg = deck['id'] + ' ' + deck['title'] + ' ' + apath, valid = True, icon = 'icon.png') wf.send_feedback() if __name__ == '__main__': wf = Workflow() log = wf.logger sys.exit(wf.run(main)) Script 2: 1. How can I get it's result to display in Alfred? 2. With very large decks (many cards), I get an error saying so, I'm thinking this is the sqlite, ideas? # -*- coding: utf-8 -*- import os, sys, re import sqlite3, json from workflow import Workflow log = None def db_cards(db, did): cards_did = db.execute("SELECT COUNT(*) " "FROM cards " "WHERE cards.did = ?", (did,) ) card_count = cards_did.fetchone() result = card_count[0] return result def main(wf): did, d_title, apath = wf.args[0].split() connection = sqlite3.connect(apath) count = db_cards(connection, did) wf.add_item( title=d_title, subtitle=unicode(count), arg=did, valid=True, icon='icon.png') wf.send_feedback() if __name__ == '__main__': wf = Workflow() log = wf.logger sys.exit(wf.run(main))
  6. Anki is a powerful flashcard program. It is written in python and fully documented. There are two primary areas where Anki excels. 1. The spaced repetition algorithm. 2. Its fully customizable. Types of Cards: Basic: Side1=Question, Side2=Answer Cloze Deletion: Essentially a fill in blank, but extremely useful. Example of Cloze: This is what is written: Ventricular {{c1::Tachycardia}} is caused by {{c2::reentry}}. Antiarrhythmic drugs alter the {{c1::absolute}} refactory period or {{c1::conduction}} {{c1::velocity}} to prevent {{c2::reentry}}. The c1 and c2 are two different cards. The c1 would show as: Ventricular ___ is caused by reentry. Antiarrhythmic drugs alter the ___ refactory period or ___ ___ to prevent reentry. The c2 would show as: Ventricular Tachycardia is caused by ___. Antiarrhythmic drugs alter the absolute refactory period or conduction velocity to prevent ___. Optionally, you can designate a hint when writing the cloze deletion: Ventricular {{c1::Tachycardia::BMP > 100}} is caused by {{c2::reentry}}. So the result would display as: Ventricular [BPM > 100] is caused by reentry. There is also the possibility to add an image to the "Extra" field. There are many other options, but I just highlighted a few. This endeavor is well beyond my scope of expertise, and this post is basically a "shot in the dark" as I don't expect anyone to actually assume this task. I thought maybe, just maybe, there is someone out there who is so well versed in the arts of Alfred and Python that this request would be trivial. Med students everywhere would be forever grateful. best,
  • Create New...