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.3.tar.gz (48.8 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.3-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yaml2anki-0.1.3.tar.gz
  • Upload date:
  • Size: 48.8 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.3.tar.gz
Algorithm Hash digest
SHA256 8320c744df1de4f5a138b5a405fdedd9a79005d72672405ca95abc9c6ec13dc5
MD5 609bd84db861371945832ce6ebd9047d
BLAKE2b-256 81b62c3b298b82e78cbb7fc8b7d38221778622f69be5b03595443e29c3cac978

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yaml2anki-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6401f561dce2e5bdb8617953b436a200ad1b903332f18b98b8ba5261d6581ffc
MD5 b8e86c99d635f8c461ed0da01d3d0a87
BLAKE2b-256 e7ac75f7d864f7eb73ea57d37069ac2da6d46eab306b65b6040938ac902d0753

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