Metadata-Version: 2.4
Name: whisper-srt
Version: 0.4.1
Summary: CLI tool to transcribe MP3 audio to SRT subtitles using OpenAI Whisper API
Author-email: tomada1114 <tmasuyama1114@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/tomada1114/whisper-srt
Project-URL: Repository, https://github.com/tomada1114/whisper-srt
Project-URL: Issues, https://github.com/tomada1114/whisper-srt/issues
Keywords: transcription,whisper,srt,subtitles,audio,openai
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openai>=1.0.0
Requires-Dist: python-dotenv>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest<9.0.0,>=7.4.0; extra == "dev"
Requires-Dist: pytest-mock<4.0.0,>=3.12.0; extra == "dev"
Requires-Dist: pytest-cov<6.0.0,>=4.1.0; extra == "dev"
Requires-Dist: mypy<2.0.0,>=1.7.0; extra == "dev"
Requires-Dist: ruff<1.0.0,>=0.1.0; extra == "dev"
Dynamic: license-file

# whisper-srt

CLI tool to transcribe MP3 audio files to SRT subtitle format using OpenAI Whisper API.

English | [日本語](https://github.com/tomada1114/whisper-srt/blob/main/README.ja.md)

## Features

- Simple CLI for MP3 to SRT conversion
- High-accuracy transcription via OpenAI Whisper API (`whisper-1`)
- Built-in AI/tech terminology for better recognition
- Custom vocabulary support

## Quick Start

**No installation required** - just run with [uv](https://docs.astral.sh/uv/):

```bash
# Set your OpenAI API key
export OPENAI_API_KEY="your-api-key"

# Transcribe (creates audio.srt)
uvx whisper-srt audio.mp3
```

Get your API key from [OpenAI Platform](https://platform.openai.com/api-keys).

## Installation (Optional)

If you prefer a permanent install:

```bash
uv tool install whisper-srt
whisper-srt audio.mp3
```

> **Note**: If you see `Executable already exists` error, use `--force` to overwrite:
> ```bash
> uv tool install whisper-srt --force
> ```

## Upgrade

If you have whisper-srt installed, upgrade to the latest version:

```bash
uv tool upgrade whisper-srt
```

## Usage

```bash
whisper-srt input.mp3                    # Basic usage (default: English)
whisper-srt input.mp3 -o output.srt      # Specify output
whisper-srt input.mp3 --language ja      # Specify language (Japanese)
whisper-srt --help                       # See all options
```

## Initial Setup

Run `--init` to configure default settings interactively:

```bash
whisper-srt --init
```

This command:
1. Creates a vocabulary file at `~/.config/whisper-srt/vocabulary.txt`
2. Prompts you to select a default language (saved to `~/.config/whisper-srt/language.txt`)

After setup, you can skip the `--language` option for everyday use.

## Supported Languages

Default language is **English (`en`)**.

Common language codes (ISO-639-1):
| Code | Language | Code | Language |
|------|----------|------|----------|
| `en` | English | `ja` | Japanese |
| `zh` | Chinese | `ko` | Korean |
| `es` | Spanish | `fr` | French |
| `de` | German | `pt` | Portuguese |

See [OpenAI Whisper documentation](https://platform.openai.com/docs/guides/speech-to-text) for all supported languages.

## Custom Vocabulary

Create `~/.config/whisper-srt/vocabulary.txt` with domain-specific terms:

```
YouTube
Podcast
MyCompanyName
```

## Pricing

$0.006/minute (~$0.36/hour)

## Development

```bash
git clone https://github.com/tomada1114/whisper-srt.git
cd whisper-srt
uv sync --dev
make ci   # lint + type-check + test
```

## License

MIT
