Skip to content

Python3 module to convert Txt, Org, Word or LibreOffice files into Anki decks

License

Notifications You must be signed in to change notification settings

sandersantema/org_to_anki

 
 

Repository files navigation

org_to_anki

Build Status codecov

Python module to convert org or txt files into Anki question decks.

Provides two command line scripts. First is to upload an org or txt files to Anki. The second allow quick notetaking and storage.

Based on AnkiConnect. An addon for Anki that provides a HTTP api for Anki.

Contents

  1. Supported file types
  2. What is an org file
  3. Using Org or text files
  4. Using Word or LibreOffice files
  5. Installation
  6. Comand line scripts
  7. Running tests
  8. Contributing

Supported file types

This project supports reading from both .org, .txt, .docx (Word) and odt (LibreOffice) files.

To use Word or LibreOffice files these must first be saved as HTML files. Please read the documentation on this.

What is an org file?

An org files a basic text file, very similar to .txt files. The file type is from Org Mode for Emacs but really you don't need to know much about this.

This is all you need to know for this project.

  • Asterisks ( * ) are used to to create bullet point style lists.

  • .org files are series of lists

  • A list item for a question starts with *

  • A list item for a answer starts with **

  • A comment starts with a #

Examples are provided below.

Here is some example syntax for how question should be laid out

* Question
** Answer 1
** Answer 2
* Another Question
** Another answer

More information on org-mode

Org mode is for keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system

orgmode homepage

Org and Text files

Documentation on Org and Text files

LibreOffice and Word

Documentation on LibreOffice or Word files

Installation

Requirements

  1. Have the Anki app installed.

  2. 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 on Linux or OSx.

git clone https://github.com/c-okelly/org_to_anki
cd org_to_ani
python3 setup.py install

Command line scripts

org_to_anki

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

Config values

  • 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/

Testing

A number of extra libraries are used in testing

  • To run unittests
python3 setup.py nosetests

Contributing

All contributions are welcome. Please open a issue first to discuss your ideas! 4. Using Word or LibreOffice files

About

Python3 module to convert Txt, Org, Word or LibreOffice files into Anki decks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 67.6%
  • Python 32.4%