Metadata-Version: 2.4
Name: reibosub
Version: 0.1.0
Summary: Human-in-the-loop OCR, ASR, glossary, translation, and subtitle refinement for video.
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/YuqiPlus/ReiboSub
Project-URL: Repository, https://github.com/YuqiPlus/ReiboSub.git
Project-URL: Issues, https://github.com/YuqiPlus/ReiboSub/issues
Keywords: subtitle,ocr,asr,translation,video
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Multimedia :: Video :: Conversion
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opencc-python-reimplemented<0.2,>=0.1.7
Requires-Dist: packaging>=24
Provides-Extra: translate
Requires-Dist: requests<3,>=2.31; extra == "translate"
Requires-Dist: pyyaml<7,>=6.0; extra == "translate"
Provides-Extra: download
Requires-Dist: reibosub[translate]; extra == "download"
Requires-Dist: yt-dlp[default]>=2026.8.19; extra == "download"
Requires-Dist: Pillow<13,>=10; extra == "download"
Provides-Extra: video
Requires-Dist: opencv-python<5,>=4.8; extra == "video"
Requires-Dist: Pillow<13,>=10; extra == "video"
Provides-Extra: ocr
Requires-Dist: reibosub[translate,video]; extra == "ocr"
Requires-Dist: paddleocr<4,>=3.0; extra == "ocr"
Provides-Extra: web
Requires-Dist: reibosub[download,translate]; extra == "web"
Provides-Extra: all-cpu
Requires-Dist: reibosub[asr,ocr-cpu,web]; extra == "all-cpu"
Provides-Extra: ocr-cpu
Requires-Dist: reibosub[ocr]; extra == "ocr-cpu"
Requires-Dist: paddlepaddle<4,>=3.0; extra == "ocr-cpu"
Provides-Extra: asr
Requires-Dist: faster-whisper>=1.1.0; extra == "asr"
Provides-Extra: diarization
Requires-Dist: pyannote.audio<5,>=4.0; extra == "diarization"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: reibosub[translate]; extra == "dev"
Requires-Dist: tomli>=2; python_version < "3.11" and extra == "dev"
Dynamic: license-file

# ReiboSub

A lightweight Python subtitle toolkit with read/write, format conversion, Chinese
Simplified/Traditional conversion, and pluggable, timing-locked LLM translation.
Python 3.10+ · Apache-2.0 · early 0.x API.

## Install

```bash
python -m pip install reibosub
```

The default installation needs only OpenCC and packaging. It does **not** install
OCR/ASR frameworks, models, CUDA, FFmpeg, Node, or a running website.

## Read, write and convert

```python
from reibosub import Cue, Subtitle, convert

subtitle = Subtitle((Cue(1, 0.5, 2.0, "繁體字幕"),), language="zh-Hant")
subtitle.save("input.srt")
loaded = Subtitle.load("input.srt")
loaded.save("output.vtt")
loaded.to_simplified().save("simplified.srt")
loaded.to_traditional().save("traditional.srt")
convert("input.srt", "output.json")
print(loaded.to_text())
```

Times use seconds. Operations return new objects. Saving refuses to overwrite an
existing file unless `overwrite=True` is explicit. Supported formats: SRT, VTT,
ASS/SSA, JSON, BCC, LRC and TXT. Conversions do not preserve all ASS styles,
effects or VTT positioning; TXT creates synthetic timings when read.

## Translate with your own provider

```python
from getpass import getpass
from reibosub import Subtitle, Translator

client = Translator(
    base_url="https://your-provider.example/v1",  # replace with your endpoint
    api_key=getpass("API key: "),
    model="your-model-id",  # replace with an available compatible model
    glossary={"ReiboSub": "ReiboSub"},
)
client.translate(
    Subtitle.load("input.srt"), source_language="ko", target_language="zh",
).save("output.zh.srt")
```

Requires a Chat Completions-compatible service and may incur provider charges.
Credentials must be supplied explicitly; no website configuration is read. Cue
counts, indexes and timing are locked; semantic accuracy still needs review.
Implement `TranslationBackend.translate_batch()` to use a local model or another
SDK. The default install already includes the public HTTP translator.

## Optional features and diagnostics

```bash
python -m pip install 'reibosub[download]'
python -m pip install 'reibosub[asr]'
reibosub doctor core
reibosub setup asr --dry-run
```

Extras: `translate` (legacy translation dependencies), `download`, `video`, `ocr`,
`ocr-cpu`, `asr`, `diarization`, `web`, `all-cpu`, `dev`. Recognition engines,
device compatibility, external tools and model authorization require separate
setup. `ocr` does not choose a CPU/GPU Paddle engine. Do not install `ocr-cpu`
over GPU Paddle. Package diagnosis never installs anything; installation needs
explicit consent, e.g. `reibosub setup asr --yes`, in an isolated environment.
Do not modify an environment used by a running service.

The web application, frontend build and complete video workflows use a **source
checkout**, not just this wheel. OCR/ASR extras install dependencies; they are not
new stable public Python engine APIs.

- [Python API and extension guide](https://github.com/YuqiPlus/ReiboSub/blob/main/docs/python-api.md)
- [Runnable development examples](https://github.com/YuqiPlus/ReiboSub/tree/main/examples/python_api)
- [Website setup / 中文说明](https://github.com/YuqiPlus/ReiboSub/blob/main/README.zh-CN.md)
- [Source and issues](https://github.com/YuqiPlus/ReiboSub)
