Python module to convert org files into Anki question decks.
Provides two command line scripts to upload org files and take new basic notes quickly.
Based on AnkiConnect. An addon for Anki that provides a HTTP api for Anki.
- Requirements
- Installation
- Comannd line scripts
- Org file syntax
- Default values
- Running tests
- Future features
-
Have Anki app installed.
-
Installing the Anki plugin AnkiConnect.
i. For OSX users of anki-connect see note for OSX users
ii. For Windows users of anki-connect see notes for Windows users
To install this module from source.
- git clone https://github.com/c-okelly/org_to_anki
- cd into the module directory
- python3 setup.py install
org_to_anki
- Upload the default org file to Anki
org_to_anki /path/to/your/org/file.org
- Upload the specified file to Anki
- New questions are added to the default file stored at ~/orgNotes/quickOrgNotes.org
- This file is created by default if it does not already exist
ankiq
- Will start a Python input reply.
- Takes a questions and a series of anwers
- Empty line add a new question to the default org file
- Currently supports two different types of org files
- All questions and answers should start with an asterix
- All comment lines start with a #
# Line comments
* Question
** Answer
- Each org file will be converted into its own deck in Anki
- Parameters to be inherited by all questions / decks should be specified at the top file.
- These will be overwritten by parameters lower down the tree.
# Basic Example
# type=Basic
* Question
** Answer
* Second Question
# type=Basic (and reversed card)
** Second Answer
- Sample answer and question in org file
* What is the capital of Ireland?
** Dublin
-
Each topic will be turned into its own subdeck. The name of this deck is given by the first line. E.G Capitals cities and Spoken languages.
-
Allows for a group of related topics to be managed in a single file.
-
Sample answer and questions for topics org file.
* Capital cities
** What is the capital of Ireland?
*** Dublin
* Spoken languages
** What are the main spoken languages in Ireland?
*** English
*** Irish
- Supported parameter syntax.
- Each line must start with a hashtag
# type=Basic
# type = Basic
- Currently supported parameters are questions type
- Org file type
- By default all org files will be of basic type.
- If you want to use a topics layout must be specified at the top of the file.
# Comment line
# fileType=topics
* Topics 1
** Questions 1
*** Answer 1
- Question type. Used to set the type of the Anki note. i. Default value is Basic
# type=Basic
# type=Basic (and reversed card)
- Questions and decks will inhert parameters from parent Decks
- Parameters inhereted will not override existing parameters.
- Config in project root contains all the default values for running
- Default org file is located at ~/orgNotes/quickOrgNotes.org
- Default anki-connect url is http://127.0.0.1:8765/
A number of extra libraries are used in testing
- To run unittests
python3 setup.py nosetests
- Check to see if note exists before sending to Anki
- Expanded support for different paramters types
- If you have a feature you would like to see please open an issue!