Generate Anki flashcard decks for JLPT Kanji with customizable templates
Project description
Anki Kanji Deck Generator
A Python script built to generate Anki flashcard decks for JLPT Kanji with customizable templates. This tool efficiently fetches comprehensive Kanji data using the Kanjilive API and utilizes the genanki library to create high-quality, structured Anki decks tailored for Japanese language learners.
🌟 Features
- Flexible Filtering: Generate decks based on standard JLPT Levels (N5 to N1) or Kyōiku Kanji School Grades (Grade 1 to 6).
- Customizable Templates: Supports using custom HTML (
.html) and CSS (.css) templates (located insrc/generator/template) for unique card styling. - Rich Kanji Data: Fetches detailed information (readings, meanings, stroke order, compounds, etc.) via the Kanjilive API.
- Modern Python Tooling: Managed using Poetry for robust dependency management and project structure.
🛠️ Prerequisites
- Python 3.11 (Required version as per
pyproject.toml) - Poetry (Recommended dependency manager)
🚀 Installation
This project uses Poetry for dependency management and environment setup.
-
Clone the Repository:
git clone [https://github.com/arirismansyah/anki-kanji-deck-generator.git](https://github.com/arirismansyah/anki-kanji-deck-generator.git) cd anki-kanji-deck-generator
-
Install Dependencies:
Poetry will read the
pyproject.tomlfile, create a virtual environment, and install all required packages.poetry install
💡 Usage
To run the generator and create your Anki deck, execute the main script within the Poetry environment.
-
Execute the Generator:
poetry run python src/generator/main.py
Note: Before running, ensure you configure the script (e.g., in
src/generator/main.py) to specify whether you are generating by JLPT Level or School Grade. -
Generated Deck:
Upon successful execution, a new Anki package file (e.g.,
Kanji_Deck_N4.apkgorKanji_Deck_Grade3.apkg) will be created in the designated output directory. -
Import into Anki:
Open your Anki application and import the generated
.apkgfile via File → Import.
📦 Key Dependencies
| Package | Purpose |
|---|---|
genanki |
The core library for programmatic generation of Anki decks. |
requests |
Handling HTTP requests to fetch data from the Kanjilive API. |
pandas |
Data manipulation and structuring of Kanji entries. |
pydantic |
Data validation for the fetched Kanji schema. |
🤝 Credits
This project relies on the following excellent tools and services:
- Kanjilive API: The source for comprehensive Kanji data.
- genanki: The library used for deck construction.
📄 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
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_kanji_deck_generator-0.1.0.tar.gz.
File metadata
- Download URL: anki_kanji_deck_generator-0.1.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1ef9052ba113ab2552723009ea6825bce08b8c9169c0a5e7830d4c398d6c79d
|
|
| MD5 |
e4c4467c45deb4df084709acdc6b627a
|
|
| BLAKE2b-256 |
85ec901217f32ac001b4cbc60e96482e50a0e899d90e198b11ad8574485e1a9b
|
File details
Details for the file anki_kanji_deck_generator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: anki_kanji_deck_generator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11732a95caa2e641cc8297c7f1af3b8ed17992ddbb52c1cfea2aad171cfa8cb9
|
|
| MD5 |
272d8a9ac793f7be5334957d1c2a7a10
|
|
| BLAKE2b-256 |
69822228754a90930ca0685f37dbcdb7281295eed95344d200be16b8acfb35f6
|