Git Product home page Git Product logo

anki-forvo-enrich's Introduction

Code and docs written by ChatGPT. Proofread and edits by human.

What it is

This script fetches pronunciation audio for words in Anki flashcards from forvo.com. It processes Anki flashcard export files in plain text format and adds pronunciation audio links to each flashcard. Anki will automatically play those audio.

Prerequisites

  • Node.js installed on your system.
  • Anki app installed on your system.
  • You cards front include only the word you want to fetch pronunciation for. Articles are allowed (see usage for details).

Usage

  1. Export your Anki flashcards. Use following options:

    • make sure all card front should be in target language (the one we want to fetch pronunciation for)
    • "Notes as in Plain text" format
    • all checkboxes unchecked (except for "Include unique identifier")Screenshot
  2. Run the script using the following command:

    npx your-script-name <path-to-file> <lang> --articles <list>

    Replace <path-to-file> with the path to your exported Anki file and <lang> with the ISO 639-1 language code. Articles are optional comma separated list of article for <lang>. If no article is provided, the script will attempt to fetch pronunciations ignoring articles if needed. Example: npx your-script-name /tmp/Spanish.txt es --articles "el,la"

  3. After processing, a new file with pronunciation links will be generated in the same directory as your original file. See script output for details.

  4. Import this new file back into Anki using the "Import" feature. You can either use new deck or import into existing deck, existing cards will be updated.

Screenshot

Screenshot

Libs Used

  • axios: For making HTTP requests.
  • cheerio: For parsing HTML and extracting data.
  • fast-csv: For reading and writing deck files.
  • fs: For handling file system operations.
  • path: For handling file paths.
  • ISO-639-1: For validating ISO 639-1 language codes.
  • os: For handling OS-specific operations.
  • chalk: For colored console output.
  • commander: For command-line interface options.

anki-forvo-enrich's People

Contributors

h1d avatar

Stargazers

april 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.