Skip to main content

yaml2anki

PyPI Version Python Versions License: MIT Build Status

YAML to Anki converter and printable flashcard generator.

Installation

Install using uv:

uv tool install yaml2anki

Install using pip:

pip install yaml2anki

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

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.

apkg

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

uvx 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

uvx yaml2anki mydeck.yaml -i

print

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

uvx 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.

uvx yaml2anki mydeck.yaml --html output.html

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.2.tar.gz (48.4 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.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yaml2anki-0.1.2.tar.gz
  • Upload date:
  • Size: 48.4 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.2.tar.gz
Algorithm Hash digest
SHA256 543b839fcaa5a6b8fdf867ff254062f5d81da379a2c45cb355b4cc5daac4317a
MD5 014c81ffc3dd897511ab289264bcd4ae
BLAKE2b-256 da5348770bc0fd8fcedf8d580815fb286532872ec14381f4dfac091b85d79f40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yaml2anki-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 086ad04a168dc7ccc298393f25bbfe6a89b8b824ac6a9af29060bdd41dd41389
MD5 637530b1fbce4ede8a23300d34426234
BLAKE2b-256 f259daeb4de3edb382e405d0e8400eb230fd33c43b40d6b9804a52b1039a59e2

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