A Clojure Anki-file interaction library to read and write .anki2 and .apkg files
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
res
src/clj_anki
test/clj_anki
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
project.clj

README.md

clj-anki

A Clojure library designed to allow programmatic interaction with Anki packages.

Build Status Clojars Project

deps.edn

clj-anki {:mvn/version "0.0.4"}

Leiningen/Boot

[clj-anki "0.0.4"]

Gradle

compile "clj-anki:clj-anki:0.0.4"

Maven

<dependency>
  <groupId>clj-anki</groupId>
  <artifactId>clj-anki</artifactId>
  <version>0.0.4</version>
</dependency>

Usage

After including this library

(require '[clj-anki.core :as anki])

You can write questions, answers, and tags to Anki packages. For example, to write some math questions with the tag "math" to a file called "math.apkg", you could:

(let [cards ["3 + 4" "7"
             "4 + 5" "9"]
  (anki/notes-to-package! cards "math.apkg"))

The resulting package you can import into Anki.

You can also read notes from Anki packages:

(anki/read-notes "math.apkg")

Which after the above returns:

({:question "4 + 5", :answers ["9"], :tags #{"math"}}
 {:question "3 + 4", :answers ["7"], :tags #{"math"}})

Slightly more in-depth documentation can be found here.

License

Copyright © 2016-2017 Archenoth

Distributed under the Eclipse Public License version 1.0