Skip to main content

Command-line tool for learning foreign languages through gradual exposure to new vocabulary

Project description

PreLing

PreLing is a command-line tool for improving language comprehension skills through gradual exposure to new vocabulary. It supports every language that spaCy supports. Because PreLing uses GPT under the hood, you must have a paid OpenAI account and an API key to run it.

Installation

Install Python 3.12 or later and pipx, then run:

pipx install preling          # install
pipx install "preling[ja]"    # alternatively: install with Japanese support
pipx upgrade preling          # upgrade
pipx uninstall preling        # uninstall (hopefully you won't need this)

Initialize a New Language

Prepare a plain-text file that contains one sentence per line in the language you want to learn. For example, you can download a monolingual corpus from OPUS. Then run:

preling init <lang> <corpus>

<lang> is the language code, and <corpus> is the path to the corpus file.

Study a Language

preling study <lang> [--audio] [--audio-only] [--model <GPT_MODEL>] \
               [--tts-model <TTS_MODEL>] [--api-key <OPENAI_KEY>] [--tts-api-key <OPENAI_OR_GCLOUD_KEY>]
  • <lang> – the language code you initialized earlier.
  • --audio – play audio along with the text.
  • --audio-only – play audio without displaying the text.
  • --tts-locale – the locale for text-to-speech (e.g., en-US, ja-JP); required for Gemini models.
  • --model – the GPT model to use for grammar evaluation.
  • --tts-model – the text-to-speech model to use for audio playback.
  • --api-key – your OpenAI API key.
  • --tts-api-key – your OpenAI API key for text-to-speech, or path to Google Cloud service account JSON file for Gemini models.

Instead of passing these options each time, you can set the environment variables PRELING_API_KEY, PRELING_MODEL, PRELING_TTS_API_KEY, and PRELING_TTS_MODEL.

View Your Progress

preling stats <lang>

Other Commands

preling path <lang>               # show the path to the language data file
preling delete <lang> [--force]   # delete the language data file; use --force to skip the confirmation prompt

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

preling-1.5.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

preling-1.5.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file preling-1.5.0.tar.gz.

File metadata

  • Download URL: preling-1.5.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for preling-1.5.0.tar.gz
Algorithm Hash digest
SHA256 4b76aa8f1875ac4022bf67b341d3de44ea7b2024fce2ec19e51db7b7a9acf072
MD5 4dd658e66030f0dd945fe7ac2cf0201c
BLAKE2b-256 946b5db91c5a02a98ed212bdbb15b943e6d7fd8d05057399c6103ac09461ca7b

See more details on using hashes here.

File details

Details for the file preling-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: preling-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for preling-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d00109636b958e990a69a8a0c984e7509e8c0e5e756a12644d5f3a290f423c50
MD5 c40c1581d4897500aad9d7515c52f94e
BLAKE2b-256 379fe501966fb0f1335c91f138504dbd873e989c607021c81b23ab3b0fb2b84c

See more details on using hashes here.

Supported by

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