Skip to main content

yaml2anki

YAML to Anki converter and printable flashcard generator.

Usage

The program takes up a YAML file of a specific format and does one of the following actions.

  1. Create .apkg file
  2. Import to anki via AnkiConnect
  3. Generate a printable document of flashcards

apkg

The following command will generate a .apkg file in the current directory.

python -m yaml2anki mydeck.yaml -o mydeck.apkg

import to anki

This option requires installation of AnkiConnect as an add-on. After installation of the add-on, close the app and launch it again so that changes can take effect. While anki instance is running, run the following command

python -m yaml2anki mydeck.yaml -i

print

The following command will generate a pdf file in the current directory.

python -m yaml2anki mydeck.yaml --pdf output.pdf

The pdf document should have an even number of pages where front and back of flashcards meet each other. After printing the document, you can cut the cards around the dashed lines to get your physical cards. Similarly, the following command generates a printable html document.

python -m yaml2anki mydeck.yaml --html output.html

input file format

The following is a simple example of a valid YAML file.

deck_name: "Python Basics"
cards:
  - front: "What is a `list` in Python?"
    back: "An ordered, mutable sequence of elements."
    tags: ["python", "data-structures"]

  - front: "How do you define a function?"
    back: "Using the <code>def</code> keyword."
    tags: ["python", "syntax"]

Refer to examples folder for more examples.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yaml2anki-0.1.1.tar.gz (47.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yaml2anki-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file yaml2anki-0.1.1.tar.gz.

File metadata

  • Download URL: yaml2anki-0.1.1.tar.gz
  • Upload date:
  • Size: 47.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for yaml2anki-0.1.1.tar.gz
Algorithm Hash digest
SHA256 530c59550ec3cdc22e9761910d861aa918fee0a2a9c8c688683b4c4f66452c1f
MD5 1ca69aa68dc20bd1d0f8920223e5eae5
BLAKE2b-256 39cd93d922ec7a4409595703a726b39533a40ef27cfad9f536646099d00e02e9

See more details on using hashes here.

File details

Details for the file yaml2anki-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: yaml2anki-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for yaml2anki-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1751989d8dc763236ea578abadb54aaf0bcb0d0c14ef0a96727467acd25ba56
MD5 18b990efbb0aff6a63c14f9345140f0a
BLAKE2b-256 2a462acd07a0fa3d052ad6c3a15a8cfd075c044d7cf210e9cf040e32419c079e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page