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.1.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.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: word_gen_card-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 57070fa93bf9d315135e6404ed6ab6286fc3cdb4530e09c489fc2ee967699813
MD5 a77b5cd74bea80a4fecf4ba6644064c8
BLAKE2b-256 78e1ee6148bae2ad10b8a3de90fbc722e04c2da00f28c7c320c0bd1a93ed5ced

See more details on using hashes here.

File details

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

File metadata

  • Download URL: word_gen_card-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4da9b685055760ac614e88837d67a45c3dbba7f877d0ff2dde6a9e8b2f238d98
MD5 fbf28f55e2425dfcf570b0ab4be62364
BLAKE2b-256 dc94ab053b9fc3bed61ac348ba6f2e1b38c87843bb9edf23a9111a44c4efe85f

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