Skip to main content

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

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

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

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.

Independent development

This directory is the standalone library product. Its implementation is under src/reibosub; tests, examples and packaging configuration belong to this product. It never imports the web application, reads its settings or discovers its credentials.

# From the repository root:
python -m pip install -e "./packages/subtitles[dev]"
cd packages/subtitles
python -m pytest tests -q
python -m pip install "build>=1.2,<2"
python -m build
reibosub doctor core
reibosub setup core --dry-run

Only the dev extra belongs to this library. Website, download and recognition extras belong to the root reibosub-web source project. They are not public OCR/ASR engine APIs. See the web guide.

Version 0.1.1 is the first toolkit-only distribution. It retains the subtitle API while removing the bundled video_translate application, recognition/web extras and legacy video command forwarding. Install/develop the website from the repository root instead; see migration notes. The published 0.1.0 files remain unchanged. Do not upgrade an environment used by a running website; test the package in its own environment first.

API and extensions · Examples

Metadata

Release files for reibosub 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reibosub 0.1.1
File Size Uploaded Provenance Actions
reibosub-0.1.1.tar.gz 29.0 kB With provenance Details for reibosub-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reibosub 0.1.1
File Interpreter ABI Platform Actions
reibosub-0.1.1-py3-none-any.whl Python 3 none any Details for reibosub-0.1.1-py3-none-any.whl

Total release size: 54.3 kB

Release files / reibosub-0.1.1.tar.gz

Download URL reibosub-0.1.1.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
75e91ab67e95a2973833ee43641d1c0c88f8a285677513386f311ee36b70bee0
BLAKE2b-256 checksum
How to use checksums
8156c1aea5e5f2e31a37cad802a2347f6a52f42042bfed0255d08c865d07f219
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / reibosub-0.1.1-py3-none-any.whl

Download URL reibosub-0.1.1-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccbca04b9c4e1d9845c3e54e484f1df61f8011cb3481b36e37854935a675b1b4
BLAKE2b-256 checksum
How to use checksums
d2121c21c67b54d70bbfe4d887e901e5a19dc97925c33f3700abc85158cbdebf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for reibosub 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for reibosub-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page