Skip to content
/ anki-thai Public

Build an Thai Vocab Anki deck from a JSON file

License

Notifications You must be signed in to change notification settings

waf/anki-thai

Repository files navigation

This repository builds a thai.apkg file (for importing into Anki/AnkiDroid) from the JSON file resources/cards.sealang.json. It's built around thai/english language flashcards, but it shouldn't be too hard to repurpose it for other JSON files.

Download

If you just want the Thai flashcards generated by this library, download dist/thai.apkg.

Installation

If you want to generate your own Anki flash card deck (.apkg), clone this repo and modify the python script as required.

Modification

Modify the json-to-anki.py script. The script reads a json file that contains an array of the objects:

{
    "rank":"1",
    "source":"AUA Reader AUA Chapter 01",
    "thai": "ดี",
    "english":"good"
}

If you import this file, it would not have any nested decks in the resulting Anki deck (because it's a flat array of cards). If you want categories (in this case, a category for each chapter), you would design a source map like this:

{
    "AUA Reader AUA Chapter 01": {
        "source": "AUA Lessons::Chapter 01"
    },
    "AUA Reader AUA Chapter 02": {
        "source": "AUA Lessons::Chapter 02"
    }
}

json-to-anki.py

Converts a json file to an APKG file, with support for nested decks.

# generate cards from a source json file
$ ./json-to-anki.py

split-json

A helper script for splitting large JSON files into smaller JSON files.

# list all sources
$ ./split-json.py list

# split source
$ ./split-json.py split $source $outfile

# example
$ ./split-json.py split SEAlang SEAlang.json

SEALang deck

The SEALang deck generated from the cards.sealang.json file contains the following categories ("nested decks"):

  • AUA Lessons
    • Chapter 01
    • ...
    • Chapter 60
  • Common Parts of Speech
    • Adjective Comparisons
    • Adjective Stative Verbs
    • Adjectives
    • Classifiers
    • Nouns
    • Prefixes
    • Prepositions of Location
    • Verbs
  • Phonology
    • Consonants - High Class
    • Consonants - Low Class
    • Consonants - Middle Class
    • Long Vowels
    • Short Vowels
  • Topics
    • Abbreviations
    • Academic Words
    • Alphabet Words
    • Animals
    • Art
    • Astronomy
    • Body
    • Books
    • Buddhism
    • Buildings
    • Business
    • Calendar
    • Cloth
    • Clothes
    • Colors
    • Compass
    • Computer
    • Construction
    • Containers
    • Court
    • Crime
    • Directions
    • Economics
    • Education
    • Elections
    • Emergencies
    • Emotion
    • Environment
    • Everyday Conversation
    • Family
    • Feelings
    • Food
    • Fruits and Vegetables
    • Fuel
    • Geography
    • Government
    • Heart
    • Home
    • Important Places
    • International Relations
    • Job Applications
    • Jobs
    • Maanii Book Vocab
    • Materials
    • Math
    • Measurement
    • Military
    • Ministries and Bureaucracy
    • Miscellaneous
    • Music
    • Narcotics
    • Nature
    • Numbers
    • Paperwork
    • People
    • Personal Information
    • Places
    • Politics
    • Questions
    • Reading Vocabulary
    • Religion
    • School
    • Senses
    • Situation
    • Sports
    • TV and News
    • Terrorism
    • Thai Geography
    • The King and Royal Family
    • Time
    • Transportation
    • Weapons
    • Weather
    • Web
    • Writing

About

Build an Thai Vocab Anki deck from a JSON file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published