Generate an Anki deck from annotations on a text file
Project description
Purpose
The purpose of this tool is to generate an Anki deck from annotations on a text file. This was specially developed for those who use Anki to learn language vocabulary.
Input structure
- The input must be some sort of non-compressed text file (.txt, .md, etc.)
- Every line to be converted to an Anki card must start with a marker, such as
-
. Use themarker
option to set a custom marker. Every other line will be ignored. - The front and back of the cards are separated by a separator, such as
=
. Use theseparator
option to set a custom separator.
Example:
- die Katze = the cat
- das Haus = the house
Outside of these rules, you are free to populate your text file with other annotations which will be ignored when creating the deck.
Current card types
Currently, the output deck will be populated with cards from one type at a time. The currently implemented types are:
sound
: TODO: write a short description of the sound card type
Installation
Make sure you have python installed (recommended version >= 3.10) and then run in the terminal/command-line:
pip install anki_deck_from_text
How to run
Open a terminal/command-line instance and follow the general structure:
anki_deck_from_text file_name.md output_name amazing_deck_name
For all options run:
anki_deck_from_text --help
You will get the following documentation:
anki_deck_from_text [OPTIONS] INPUT OUTPUT DECK_NAME
Generate and Anki deck from annotations on a text file
Options:
--separator TEXT Character(s) that separate the text to be written to the
front and back of the cards [default: =]
--marker TEXT Character(s) marking this line to be included in the deck
[default: -]
--card_model TEXT Anki card model to build the deck with. Available options
are: `sound` [default: sound]
-h, --help Show this message and exit.
Extending the tool
Add card types
To add extra card types follow the instructions in the models.py
file docstring and then update the current available card types both in the docstring of generate_deck.py
and in the relevant section of this README.
Refer to the Anki docs for how to design Anki card type structures.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for anki_deck_from_text-1.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9161200906b4474c6ebf6fc88027b58bf469009e5959c6db0b469f13d1a0ea27 |
|
MD5 | dcfd64261f090aa352ef787ab91833dc |
|
BLAKE2b-256 | 798d4e7832ab84c4659e5a0b8efdefb160c5f369945014ef1d2a367e3701fd84 |
Hashes for anki_deck_from_text-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6a953961c022f78a29a672098b503eee921356e41597db9209217680d696201 |
|
MD5 | 9490e81f3fb4bcb7219e500c18059dde |
|
BLAKE2b-256 | 4f629d66f2025a18304abab347f6d421dbcf955dbb6d7238d2c3e9dd223d330a |