Skip to content
This repository has been archived by the owner on Nov 12, 2021. It is now read-only.
/ ace Public archive

Script that automates the creation of animecards

License

Notifications You must be signed in to change notification settings

kamui-fin/ace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACE (Anime Cards Exporter)

This old version of ace has been deprecated and will no longer be supported. Please consider using the rust rewrite instead

This is a script to make anime cards on the fly with a single hotkey on linux. It takes a sentence from yourei, an image from google images, an audio recording from forvo, and finally, a couple meanings from yomichan dictionaries of your choice, which is all packaged into 1 card and sent directly to your anki.

Installation

$ git clone https://github.com/kamui-fin/ace.git
$ cd ace
$ pip install -r requirements.txt
$ mkdir -p data/dict/{fallback,priority}
$ mkdir -p data/image_audio

Next, fill out the missing blanks in config.yml. All options are documented. Here's an example config file:

collection: "/home/username/.local/share/Anki2/profile1/collection.anki2"
deck: "My Deck"
note_type: "My Notetype"
word_field: "Word"
sentence_field: "Expression"
image_field: "Picture"
audio_field: "Audio"
meaning_field: "Meaning"
words_file: "/home/username/words.txt"
failed_words_file: "/home/username/failed.txt"

Notes:

  1. You need to type in the fields exactly as it is in anki or else it will not work.
  2. The collection is your profile's database
  3. You have to close anki before running this script

Now for the dictionary setup. There's 2 folders in the dict folder, fallback and priority. Priority is the folder where you will place your dictionaries that you want to search first. The dictionaries located in the fallback folder will be used if the program couldn't find any entries in your priority dicts.

Make sure you unzip the yomichan dictionaries to its own folder and move them to the appropriate directories inside dict. Here is an example of how it could look:

dict/
├── fallback/
│  └── jmdict_english/
└── priority
   ├── 三省堂 スーパー大辞林/
   └── 新明解国語辞典第五版v3/

Options

There are 2 options to use when running this script, --word and --parsefile.

  1. The word flag (which is the default) is used to make an anki card from the word in your clipboard.
  2. The parsefile flag is used to batch export cards from a file with the list of words, where each word is on its own line.

Hotkey

With all this setup, you can easily create a keybind for creating the card from the word in your clipboard. Most desktop environments and window managers have a place for keybinds in their system settings GUI or config file. Pick a keybind and set it to run the following command:

python src/main.py --parsefile

Note that you need to adjust to the path of main.py, depending on where you downloaded the script.

About

Script that automates the creation of animecards

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages