An automated translator of WebVTT (Web Video Text Tracks) from one language to another using generative AI.
Project description
WebVTT Translator
WebVTT Translator is a Python package for translating WebVTT subtitle files into different languages using various translation APIs.
Features
- Translate WebVTT subtitle files to multiple languages.
- Support for various translation APIs (e.g., Google Translate, Microsoft Translator).
- Easy-to-use command-line interface.
Prerequisites
Before using WebVTT Translator, you need to have an OpenAI API Key. Set the API key as an environment variable:
On Linux/macOS:
export OPENAI_API_KEY='your_openai_api_key'
On Windows (Command Prompt):
set OPENAI_API_KEY=your_openai_api_key
On Windows (PowerShell):
$env:OPENAI_API_KEY='your_openai_api_key'
Installation
You can install the package using pip:
pip install webvtt-translator
Usage
Command Line Interface
To translate a WebVTT file, use the following command:
webvtt-translator translate -i input.vtt -o output.vtt -l Portuguese
You can also run the module via python:
python -m webvtt_translator -i input.vtt -o output.vtt -l Portuguese
The command line arguments are:
-ior--input: Path to the input WebVTT file.-oor--output: Path to the output translated WebVTT file.-lor--language: Target language (e.g., Spanish, English, Portuguese).
Contact
For any questions or suggestions, please open an issue on GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file webvtt_translator-0.1.0.tar.gz.
File metadata
- Download URL: webvtt_translator-0.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5815a791b5ab8f644cffd1bc1f03ee76e1702071ab778363c77bd1207ed76f6a
|
|
| MD5 |
edb276adf9ff6f64c9d0cf7ecbc53136
|
|
| BLAKE2b-256 |
f44e110809c5f809af640d79b0c71c81266895cb581617835ed13e8debfc0454
|