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

see usage 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 fields list to self.gen_anki if using default model, like below:

from word_gen_card 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.3.tar.gz (3.8 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.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for word_gen_card-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3a5f30a9cfbd5f238fae6a39a705ee176e823f36a4c1c2a985f50e05a393f093
MD5 29b71a08ec0d5b2b88cb34230895fc14
BLAKE2b-256 5bcdf4647ebfe80b3bd1a6e8d4d9810b751b4e65f9abe5cef55c2634764b85a0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for word_gen_card-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4f5ea4b40a3d51f3d16db8b06c63a8b7dcfb6562d22b26e248dd0d20b9f0ca4b
MD5 328873a170802fa544a0dbce3db9d23b
BLAKE2b-256 6182ab40ded6ea46e56eaa3e06a6ec9675d9d91a45fbb5d906c814d828a01953

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