Skip to main content

AnkCompiler

coverage

A CLI tool for compiling Anki decks, defined in Markdown.

Installation

Run pip install ankcompiler

Usage

Run ankc --help for usage information.

Main commands:

  • ankc build compiles decks into .apkg packages.
    • Subdecks use Anki's :: naming, e.g. deck: Geo::Rivers. --deck Geo packages Geo and every Geo::... subdeck into one geo.apkg. --all writes one package per top-level deck. Upgrading from 0.3.x: delete old per-subdeck packages (e.g. geo--rivers.apkg) from your output directory so they aren't re-imported.
  • ankc check validates decks without compiling. It reports problems as file:line, and can print JSON with --format json. It also fails on missing images and on two different images sharing a filename.
  • ankc uid adds a [^uid] footnote to any card block that is missing one. It is append-only and safe to run more than once. Use --check for a dry run. It will not touch files with uncommitted git changes unless you pass --force.
    • Add --fix to also repair a draft deck whose cards are separated by a single ---. It rewrites each card into a well-formed block and stamps any missing uids. Draft fast, then run ankc uid --fix to make the deck buildable. It only restructures real decks (frontmatter with a deck: key), so it is safe on non-drafts.

Examples

See examples/example.md for a deck with every note type, tags, and math.

Note types

  • Question and answer: front ::: back. Found automatically.
  • Cloze: {{c1:: ...}}. Found automatically.
  • Basic and reversed: front ::: back plus [^type]: reversed. This makes a card in both directions.
  • Type in the answer: question ::: answer plus [^type]: type-in.

Reversed and type-in cards use the same ::: syntax as a question and answer card. So you name them with a [^type] footnote next to the [^uid].

Math

Write inline math as $...$ and block math as $$...$$. Anki renders it with MathJax. To show a real dollar sign, write \$.

Credits

Inspiration taken from lukesmurry

Metadata

Release files for ankcompiler 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ankcompiler 0.4.0
File Size Uploaded Provenance
ankcompiler-0.4.0.tar.gz 19.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ankcompiler 0.4.0
File Interpreter ABI Platform
ankcompiler-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.8 kB

Release files / ankcompiler-0.4.0.tar.gz

Download URL ankcompiler-0.4.0.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4d8b8c65e9bca1e67d3cb7de5ba5ebef4ac8fa4a51594634323b40878fb78f6a
BLAKE2b-256 checksum
How to use checksums
8a3c6e500dfa9fe524e37e334d8787c8e26f86d4c524298654b47499d8bdfddc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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}

Release files / ankcompiler-0.4.0-py3-none-any.whl

Download URL ankcompiler-0.4.0-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a67dfc873fbf6c6208b34dc131a67b4fe27aa2443a4e63811f481fd1b0c2afa
BLAKE2b-256 checksum
How to use checksums
abd2b13e88234cd609318098cb0da2c00d8f1d04973c171d5276f8c8fa418cb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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}

Security for ankcompiler 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page