Metadata-Version: 2.2
Name: lingq
Version: 1.0.0
Project-URL: Repository, https://github.com/daxida/lingq
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: aiohttp>=3.9.5
Requires-Dist: aiohttp_retry>=2.8.3
Requires-Dist: click==8.1.7
Requires-Dist: natsort==8.4.0
Requires-Dist: python-dotenv==1.0.1
Requires-Dist: yt_dlp==2024.10.22
Requires-Dist: pydantic
Requires-Dist: roman==4.2
Requires-Dist: Levenshtein
Requires-Dist: loguru
Provides-Extra: etc
Requires-Dist: beautifulsoup4==4.12.3; extra == "etc"
Requires-Dist: faster_whisper==1.0.2; extra == "etc"
Requires-Dist: requests==2.32.3; extra == "etc"
Requires-Dist: ruff==0.7.0; extra == "etc"
Requires-Dist: tqdm==4.66.4; extra == "etc"
Requires-Dist: gpt4All; extra == "etc"
Provides-Extra: test
Requires-Dist: pytest==8.2.1; extra == "test"
Requires-Dist: deepdiff; extra == "test"
Provides-Extra: all
Requires-Dist: lingq[etc,test]; extra == "all"

# LingQ

Command line utilities and scripts for interacting with [LingQ's](https://www.lingq.com/) API.

You will need a LingQ API key. You can get it from [here](https://www.lingq.com/en/accounts/apikey/).

## Installation

(Optional) Create a virtual environment: `python3 -m venv venv` and activate it.

Then either directly:
```
pip install git+https://github.com/daxida/lingq
```
Or clone the repository:
```
git clone https://github.com/daxida/lingq
cd lingq
pip install .
```

Finally, run:
```
lingq setup yourLingqApiKey
```
This will create an `.env` file in the root directory with your API key.

## How to use

Some examples:
```
# Upload a playlist to a greek course.
lingq postyt el 129129 "https://www.youtube.com/@awesomeyoutuber"

# Bulk upload a book split by chapters.
lingq post el 129139 "example/texts" -a "example/audios" --pairing-strategy zip

# Timestamp an entire german course.
lingq timestamp de 129129
```

The full set of commands can be found with `lingq --help`. 
Per command information uses again the help flag: `lingq timestamp --help`.

A command tree made with [this](https://github.com/whwright/click-command-tree):
```
cli - Lingq command line scripts.
├── get - Get commands.
│   ├── courses - Get every course from a list of languages.
│   ├── lessons - Get every lesson from a course id.
│   ├── images - Get images.
│   └── words - Get words (LingQs).
├── markdown - Generate markdown files for the given language codes.
├── overview - Library overview.
├── patch - Patch commands.
│   ├── audios - Patch a course audio.
│   └── texts - Not implemented.
├── post - Upload a lesson.
├── postyt - Post youtube playlist.
├── resplit - Resplit a course (only for japanese).
├── setup - Creates or updates an .env file with your LingQ API key.
├── show - Show commands.
│   └── my - Show a list with my collections in the given language.
├── sort - Sort all lessons from a course.
├── timestamp - Generate timestamps for a course.
└── yomitan - Make a Yomitan dictionary from a dump generated by 'get_words'.
```

## Etc.

Mainly undocumented scripts to scrape, process text and audio, and to manually use whisper.

If you want to use some of it:

```
git clone https://github.com/daxida/lingq
cd lingq
pip install .[etc]
# And for example
python3 etc/scrape/japanese/sc_itazura.py
```

## Links

- [Forced alignment](https://github.com/daxida/lingq-fa) for LingQ.
- Legacy (v1.0 and v2.0) LingQ's API [documentation](https://www.lingq.com/apidocs/index.html).
- A miniminalist [script](https://github.com/paulywill/lingq_upload) to upload content to LingQ. May not be up to date.
- A [script](https://github.com/justbrendo/lingq-yt) to upload youtube playlists to LingQ with Whisper generated subtitles.
- For [splitting](https://gist.github.com/Ashwinning/a9677b5b3afa426667d979b36c019b04) downloaded audio from youtube.
- Another API wrapper in [ruby](https://github.com/evizitei/lingq)
