Python utilities for creating Anki flashcards. Designed for AI agent integration.
Project description
anki-utils
Python utilities for creating Anki flashcards. Designed for AI agent integration.
Install
pip install anki-utils
Features
- Card Generation: Create
.apkgfiles for 6 card types (Front-Back, Concept, Cloze, Image, Person, Image Occlusion) - Theme System: 4 built-in themes (minimal, classic, high-contrast, calm)
- Markdown Support: Convert markdown formatting to Anki-compatible HTML
- Input Validation: Clear error messages for invalid card data
- Image Occlusion: OCR-based automatic region detection
- Preview Assets: React components for card preview
- Agent-Friendly: CLI commands for querying roadmap and changelog
Quick Start
# Generate .apkg from JSON
echo '{"deck_name": "Test", "cards": [...]}' | anki-utils export-apkg --output deck.apkg
# Resolve relative media paths (image_path/photo_path) against a base directory
echo '{"deck_name": "Test", "cards": [...]}' | anki-utils export-apkg --output deck.apkg --base-path /path/to/project
# List available themes
anki-utils themes --list
# Get preview template
anki-utils asset preview-template
# Detect occlusion regions in an image
anki-utils occlusion-detect image.jpg --json
For AI Agents
See AGENTS.md for complete context on working with this codebase.
anki-utils roadmap # Full roadmap
anki-utils changelog --latest # Most recent changes
Development
# Clone and install in dev mode
git clone https://github.com/Gilbetrar/anki-package.git
cd anki-package
pip install -e ".[dev]"
# Run tests
pytest -v
# Run with coverage
pytest --cov=anki_utils
Repository Structure
anki-package/
├── AGENTS.md # Context for AI coding agents
├── anki_utils/ # Published PyPI package
│ ├── exporter.py # Core .apkg generation
│ ├── markdown.py # Markdown to HTML conversion
│ ├── themes.py # CSS theme definitions
│ ├── occlusion.py # Image occlusion detection
│ ├── cli.py # Command-line interface
│ ├── ROADMAP.md # Development roadmap
│ └── CHANGELOG.md # Version history
├── tests/ # Test suite (pytest)
└── .github/workflows/ # CI/CD (runs tests on push/PR)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anki_utils-0.2.92.tar.gz.
File metadata
- Download URL: anki_utils-0.2.92.tar.gz
- Upload date:
- Size: 783.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dab1a04e6d325cc0ac33a8f7a7e130a139228ae1b4f94acc8c0e5d2fd8372ab
|
|
| MD5 |
bd8936acca1084d5e25b9879951e20f9
|
|
| BLAKE2b-256 |
24a411364e15fed67c5661567f520d04baec48d38cffd24a76bd9208789e722a
|
Provenance
The following attestation bundles were made for anki_utils-0.2.92.tar.gz:
Publisher:
publish.yml on Gilbetrar/anki-package
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anki_utils-0.2.92.tar.gz -
Subject digest:
7dab1a04e6d325cc0ac33a8f7a7e130a139228ae1b4f94acc8c0e5d2fd8372ab - Sigstore transparency entry: 796726197
- Sigstore integration time:
-
Permalink:
Gilbetrar/anki-package@08264ba7e6ef5fdd386092af0e61513a9341b4e6 -
Branch / Tag:
refs/tags/v0.2.92 - Owner: https://github.com/Gilbetrar
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@08264ba7e6ef5fdd386092af0e61513a9341b4e6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file anki_utils-0.2.92-py3-none-any.whl.
File metadata
- Download URL: anki_utils-0.2.92-py3-none-any.whl
- Upload date:
- Size: 96.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
218bb1aac9b02ed26cdf7874ea4d0cf417b68eb4e668a785e7338fdbe0f26c4c
|
|
| MD5 |
7f79dc547ea23b28a0228f6b9bf66682
|
|
| BLAKE2b-256 |
5b9da08b99c7771562f452dd1a43812e18bf0a44a5aa44de849917cb190c17c6
|
Provenance
The following attestation bundles were made for anki_utils-0.2.92-py3-none-any.whl:
Publisher:
publish.yml on Gilbetrar/anki-package
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anki_utils-0.2.92-py3-none-any.whl -
Subject digest:
218bb1aac9b02ed26cdf7874ea4d0cf417b68eb4e668a785e7338fdbe0f26c4c - Sigstore transparency entry: 796726216
- Sigstore integration time:
-
Permalink:
Gilbetrar/anki-package@08264ba7e6ef5fdd386092af0e61513a9341b4e6 -
Branch / Tag:
refs/tags/v0.2.92 - Owner: https://github.com/Gilbetrar
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@08264ba7e6ef5fdd386092af0e61513a9341b4e6 -
Trigger Event:
release
-
Statement type: