Giter VIP home page Giter VIP logo

aeag's Introduction

NEAG (aNother Easy Anki Generator)

Spend your time learning a language, not making flashcards

By [email protected] (Joel Shor)

Intro

This project generates Anki flashcards for language learning. Some sources suggest that the the most useful language-learning flashcards only have the target language, images, and audio in the target language (ex Fluent Forever), and this program generates cards in this style.

This program does the following:

Input:

  1. A CSV of English words

Actions:

  1. Translates words to target language
  2. Performs extra behavior (like stripping diacritics, if necessary)
  3. Fetches images associated with the word
  4. Fetches audio of native speakers reading the translation
  5. Writes media files to Anki's media directory
  6. Generates a CSV file so Anki can import the words and media

Outputs:

  1. Writes images and audio to the target directory (often the Anki media directory)
  2. Writes a CSV file with English, translation, audio, image, and side information

Currently, AEAG does not do the following:

  1. Actually import the notes into the desired deck.
  2. Generate the Anki card layout
  3. Set up external API accounts that you might need (Google Cloud account, etc)

How to use

Before you do anything, check to make sure that the public APIs are as expected. You'll need to get credentials for these services, or email [email protected] to use the author's. Add them to credentials.py.

Getting and testing credentials

  1. Follow the instructions at the top of images.py to get Google Custom Search Engine credentials. Information can be found at "https://developers.google.com/custom-search/".

  2. If Google Text-To-Speech doesn't have your desired language, you might need to use Forvo. Go to "https://www.forvo.com" and sign up to receive a Forvo API key.

Once your credentials are added, check that the APIs are as expected:

python check_public_apis.py

You can also check that the code hasn't suffered from bit rot:

./run_unittests.sh

Generating cards

There are two main modes. One does all the above. The second assumes you've already downloaded the media that you want, and instead just copies them to the target directory and writes the Anki import CSV. This mode is useful if you've run out of external API quota, or you want to manually control which media is associated with which card.

To run in the first mode, run:

python main.py \
--input_file=/User/test/words.csv \
--output_dir=/anki/media/folder \
--output_csv_file=/csv/for/anki/to/import

If you've already downloaded the media you want, run something like:

python main.py \
--input_file=/User/test/words.csv \
--output_dir=/anki/media/folder \
--output_csv_file=/csv/for/anki/to/import \
--already_downloaded_media_dir=/path/to/downloaded/media

That's it!

aeag's People

Contributors

joel-shor avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.