Skip to main content

a generate anki card tool from dictionary export csv file

Project description

word-gen-card

a generate anki card tool from dictionary export csv file

Installation

word-gen-card requires python version 3.10 or higher

pip install word-gen-card

Quickstart

Now Support Eudic export csv file

card_cli source_file_path to_save_path -n dect_name -d deck_id

see more details

card_cli --help

Support more csv formats

this tool default model fields like below:

fields=[
            {"name": "单词"},
            {"name": "音标"},
            {"name": "图片"},
            {"name": "声音"},
            {"name": "基本释义"},
        ],

your process_data method logic only put this struct data to self.gen_anki if using default model, like below:

from word-gen-card.src import GenAnki

class OtherDict(GenAnki):
    def process_data(self, path):
        # do your something
        fields = [word, phonetic symbols, image, f'[sound:{audio_name]', basic meaning]
        self.gen_anki(fields=fields)

also you can custom your model, see below:

my_deck = genanki.Model(
      model_id,
        "Model NAME",
        fields=[
            {"name": "单词"},
            {"name": "音标"},
            {"name": "图片"},
            {"name": "声音"},
            {"name": "基本释义"},
        ],
        templates=[
        {
            "name": "Card 1",
            "qfmt": "", # front side
            "afmt": "", # back side
        }
        ]
)
eudic = Eudic(deck=my_deck, model=my_model, source_data_path=args.source, to_path=args.to)
eudic.packge()

for more model detail see genanki repo

License

This project is open sourced under MIT license, see the LICENSE file for more details.

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

word_gen_card-0.1.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

word_gen_card-0.1.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file word_gen_card-0.1.2.tar.gz.

File metadata

  • Download URL: word_gen_card-0.1.2.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.15.2 CPython/3.12.3 Darwin/23.3.0

File hashes

Hashes for word_gen_card-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e8cad69745b1aaf084b22730639f7cec940a8d9f15d867624ed30f409e6b23a0
MD5 69fdbde7a796e376e2b3b5e85bf419c2
BLAKE2b-256 139f8ee2c3f8279fcc02894177598e434ff808d5b086644ef1cdccd9aad52d9a

See more details on using hashes here.

File details

Details for the file word_gen_card-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: word_gen_card-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.15.2 CPython/3.12.3 Darwin/23.3.0

File hashes

Hashes for word_gen_card-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04c12aa6cd4278a42a889106dadf376311dd7357f9b554831a4b67c250f0341e
MD5 0847b36894ff64c96fa818f82d52c802
BLAKE2b-256 2103daaf173f93db932a13af3665f7269de12b8f781b00ab9a6ac539127220bf

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