Skip to main content

CLI tool converting Language Transfer lessons into Anki flashcards, automating content extraction for efficient language learning.

Project description

project-banner

Language Transfer Flashcards (LTF) is a CLI tool designed to enhance your language learning experience by bridging the gap between Language Transfer's audio lessons and Anki's spaced repetition system. This project transforms the rich content of Language Transfer YouTube lessons into easily digestible flashcards, allowing learners to reinforce their knowledge effectively.

license last-commit repo-top-language PyPI - Version

About the ProjectInstallationUsageLimitationsAnki: CSV ImportNext StepsContact



About the Project

Key Features

  • Automated Extraction: Extracts words, phrases, and sentences with translations from Language Transfer YouTube lessons.
  • Anki Integration: Generates CSV files ready for direct import into Anki, creating instant flashcard decks (OpenAI API key required).
  • Alternative Workflow: Download a text file, containing the prompt and lesson transcript to use with your favorite LLM web interface (e.g., ChatGPT, Claude, etc.).

Why it's Valuable?

  • Boost Learning Efficiency: Combine Language Transfer's proven method with Anki's powerful spaced repetition.
  • Save Time: Automate hours of manual flashcard creation.
  • Customizable: Adapt to your preferred workflow, with or without API access.

Build With

Installation

Recommended: Create and activate a virtual environment before installing the tool.

Using pip

pip install language-transfer-flashcards

Using poetry

poetry add language-transfer-flashcards

Configuration with .env file [optional, but recommended]

Create a .env file in your home directory under ~/.ltf/.env with the following variables:

OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
OPENAI_MODEL_NAME=gpt-4o
TARGET_LANGUAGE=Swahili

Not sure where to create the .env file in your system?

ltf env-location

To see all valid values for the variables OPENAI_MODEL_NAME and TARGET_LANGUAGE

ltf csv --help

Note: The OpenAI-related variables are optional if you're not using the API.

Usage

Create flashcards in CSV format - file will be saved in current working directory

ltf csv https://www.youtube.com/watch?v=VIDEO_ID  # assumes .env file exists

Without the .env file, specify your target-language, the OpenAI model name and API key

ltf csv https://www.youtube.com/watch?v=VIDEO_ID -l Swahili -m gpt-4o -k "YOUR_OPENAI_API_KEY"

Usage without using the OpenAI API

Download the full prompt which is used to extract the content of the language lesson in a txt file.

ltf prompt https://www.youtube.com/watch?v=VIDEO_ID  # assumes .env file exists

If there is no .env file, add your target-language to the command, for example: -l Swahili

Manual Processing

  • Copy the downloaded content into your favorite LLM web interface - recommended: ChatGPT or Claude.
  • The output will be the content of the lesson in CSV format -> English, Translation.
  • Copy the output into a text editor and create a CSV file
  • Import the CSV file into Anki

Limitations

  • AI Imperfections: LLMs may occasionally produce inaccurate translations or misinterpret context.
  • Transcript Quality: YouTube's auto-generated transcripts can contain errors.
  • Content Discrepancies: Flashcards may sometimes differ from the exact lesson content due to transcript and AI limitations. Review your final flashcards before importing them into Anki.
  • Technical Requirements: Basic command-line knowledge is needed.
  • API Costs:
    • gpt-4o: ~$0.01 per lesson
    • gpt-4o-mini: < $0.0005 per lesson

Anki: CSV Import

  1. Open Anki
  2. Create or select a deck for your target language
  3. Navigate to File > Import
  4. Select your generated CSV file for upload
  5. Select the correct seperator for your CSV file, configure Import options and click on Import

Roadmap

  • Publish on PyPI
  • Add support for other LLMs (including Ollama)
  • Create a web-based interface for non-technical users

Contact

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

language_transfer_flashcards-0.1.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file language_transfer_flashcards-0.1.1.tar.gz.

File metadata

File hashes

Hashes for language_transfer_flashcards-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2a2b22e4b0520b7b93b2b947775f44cff04819c461208339ef4c13723f9f395a
MD5 24e2fda462719e248cf51a2ee031ad26
BLAKE2b-256 1dab91f806741cfb4dc08e182d5766c71b04df5ab6f579ae65fc0d07cf46eeb8

See more details on using hashes here.

File details

Details for the file language_transfer_flashcards-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for language_transfer_flashcards-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2040f8a253b9e01802575b3b61e67daa959779c7a5d9027c2b2eaf386341a050
MD5 a917e661a612723b76f611a8eeb3f626
BLAKE2b-256 ed53c7c107abee9ad699cab230f1c2e666ba43d8d9704082c608d9e40ff4f306

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page