Skip to main content

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 in src/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.

  1. 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
    
  2. Install Dependencies:

    Poetry will read the pyproject.toml file, 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.

  1. 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.

  2. Generated Deck:

    Upon successful execution, a new Anki package file (e.g., Kanji_Deck_N4.apkg or Kanji_Deck_Grade3.apkg) will be created in the designated output directory.

  3. Import into Anki:

    Open your Anki application and import the generated .apkg file via FileImport.


📦 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

anki_kanji_deck_generator-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

anki_kanji_deck_generator-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for anki_kanji_deck_generator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f1ef9052ba113ab2552723009ea6825bce08b8c9169c0a5e7830d4c398d6c79d
MD5 e4c4467c45deb4df084709acdc6b627a
BLAKE2b-256 85ec901217f32ac001b4cbc60e96482e50a0e899d90e198b11ad8574485e1a9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for anki_kanji_deck_generator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11732a95caa2e641cc8297c7f1af3b8ed17992ddbb52c1cfea2aad171cfa8cb9
MD5 272d8a9ac793f7be5334957d1c2a7a10
BLAKE2b-256 69822228754a90930ca0685f37dbcdb7281295eed95344d200be16b8acfb35f6

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