Skip to main content

Convert markdown files to Anki cards

Project description

md2ankicard

Convert Markdown notes (with images) into Anki decks.

md2ankicard is a command-line tool to batch-convert Markdown files into Anki .apkg file, preserving images and formatting.

✨ Features

  • 📄 Converts each .md file into an Anki note (card).
  • 🖼️ Automatically includes images referenced in Markdown.
  • 🔍 Optional --grep to filter files by keyword (e.g. by a tag).
  • 🧠 Uses the Markdown filename as the front (question) and content as the back (answer).
  • 🗃️ Outputs a standard .apkg file ready to import into Anki.

📦 Installation

pip install md2ankicard

Or with Poetry (for development):

git clone https://github.com/andrewromanenco/md2ankicard.git
cd md2ankicard
poetry install

🚀 Usage

md2ankicard <markdown_folder> <output.apkg> "<deck name>" [--grep <pattern>] [--verbose]

or if run from source code

poetry run md2ankicard PathToFilder FileName.apkg DeckName -v --grep '#SomeTag'

Examples

Convert all Markdown files in the 'notes' folder to an Anki deck

md2ankicard ./notes study.apkg "Study Notes"

Only include files that mention 'python'

md2ankicard ./notes code.apkg "Code Review" --grep "python"

Show detailed output during conversion

md2ankicard ./docs docs.apkg "Documentation" --verbose

🧠 How It Works

  • Each .md file becomes one Anki card.
  • The file name (without extension) becomes the front of the card.
  • The rendered Markdown (including images) becomes the back.
  • Images are automatically detected and embedded in the .apkg file.

📝 License

This project is licensed under the MIT License.

Project details


Download files

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

Source Distribution

md2ankicard-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

md2ankicard-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file md2ankicard-0.1.0.tar.gz.

File metadata

  • Download URL: md2ankicard-0.1.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.12.5-linuxkit

File hashes

Hashes for md2ankicard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8466f6f29183c5973693b5d46d04c665ded424fd3a9f5d42ecd026b91482e52a
MD5 3173f959e278525636eebbf8ad78151f
BLAKE2b-256 e699702158829fdb2161405d664d9e7204befbe3acf1293e4e5084a70ae174aa

See more details on using hashes here.

File details

Details for the file md2ankicard-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: md2ankicard-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.12.5-linuxkit

File hashes

Hashes for md2ankicard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 727a73cb4b32b132923938183feb825c5e18a7c1262f589f39f9328193d01e07
MD5 cf2c005dc3916a9683b7cebaf60e6f03
BLAKE2b-256 fc40aaad1339cbce9af9074b5c9ae48092acdd7f191b1eece2c725c92c272ec9

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