Skip to main content

AnkiChinese

Asynchronously scrape the ArchChinese dictionary to generate Anki flashcards

Online Flashcard Demo
Online Flashcard
Offline Flashcard Demo
Offline Flashcard

Installation

pip install ankichinese
playwright install

Usage

ankichinese

-h, --help                          Show help message and exit 

--export, -x {anki, csv, update}    Export mode (default: anki)
                                    anki: Generate new AnkiChinese deck
                                    csv: Generate CSV file
                                    update: Update existing deck
--input, -i INPUT                   Input file with characters to scrape (default: input.txt)
--output, -o OUTPUT                 Name of output file (do not include extension) 
                                    (default: ankichinese_output)

--definitions, -def NUM             Number of definitions to scrape per character (default: 5)
--examples, -ex NUM                 Number of example words to scrape per character (default: 5)

--requests-at-once, -r NUM          Maximum number of requests at once (default: 10)
--requests-per-second, -rs NUM      Maximum number of requests per second (default: 5)

Generate New AnkiChinese Deck

How to create an entirely new Anki deck with the name ankichinese_output.apkg in the current directory using custom AnkiChinese styling.

  1. Create input.txt with the characters you want to scrape.
  2. Run ankichinese -x anki.
  3. Open Anki and import ankichinese_output.apkg.

Updating is Easy!
Just run ankichinese -x anki again with new characters in input.txt and import the new ankichinese_output.apkg file into Anki. Anki will automatically update the existing deck without losing progress.

Update Existing (Non-AnkiChinese) Deck Without Losing Progress

  1. Create input.txt with the characters you want to scrape (can be the same as the existing deck).
  2. Run ankichinese -x update.
  3. Choose deck and model of cards to update. AnkiChinese will search for and overwrite any fields with the same names as the following.
Field Name Description
Hanzi Simplified character (REQUIRED)
Traditional Traditional form
Definition Meaning of character
Pinyin Most common pinyin
Pinyin 2 Other possible pinyin
Words Example words
Formation Origin / mnemonic for character
HSK Hanyu Shuiping Kaoshi level
Audio Audio file name (required for audio)
  1. Import the new ankichinese_audio.apkg file into Anki. This will import the audio files (and create an empty deck that can be deleted)

Tools Used

Credits

Character information: ArchChinese

Stroke order diagrams:

Chinese audio:

MIT License

Copyright (c) 2023 Luke Tao

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for AnkiChinese 1.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for AnkiChinese 1.3.7
File Size Uploaded Provenance Actions
AnkiChinese-1.3.7.tar.gz 10.2 MB Without provenance Details for AnkiChinese-1.3.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for AnkiChinese 1.3.7
File Interpreter ABI Platform Actions
AnkiChinese-1.3.7-py3-none-any.whl Python 3 none any Details for AnkiChinese-1.3.7-py3-none-any.whl

Total release size: 20.1 MB

Release files / AnkiChinese-1.3.7.tar.gz

Download URL AnkiChinese-1.3.7.tar.gz
Size 10.2 MB
Tags Source
SHA-256 checksum
How to use checksums
a7103da08f477d1f1b8e5d9119f74a69c2b72e8673b94a7472d565ff8642ce2e
BLAKE2b-256 checksum
How to use checksums
f59d3c81476a43f9133927ca78fcb14f2388fb76261b7c538a2f966fc6bb0588
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / AnkiChinese-1.3.7-py3-none-any.whl

Download URL AnkiChinese-1.3.7-py3-none-any.whl
Size 9.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
29372d394770b57b1eb4e8316463633996858277595f6575b061461a0ee10b68
BLAKE2b-256 checksum
How to use checksums
380ee8b066c56943356f8b882c5072604d86e19eb34723c7b008c910b31b9b14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for AnkiChinese 1.3.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page