Metadata-Version: 2.4
Name: nanovt
Version: 0.2.1
Summary: CLI tool to extract audio from video files and transcribe it with OpenAI speech-to-text.
Author-email: Xiao Li <xiaoli3397@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: audio-transcription,ffmpeg,openai,speech-to-text,video-transcription
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.13
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Requires-Python: >=3.13
Requires-Dist: openai>=1.40
Description-Content-Type: text/markdown

# nanovt

Transcribe video or audio files with OpenAI speech-to-text.

The script extracts audio with `ffmpeg`, converts it to mono 16 kHz WAV,
splits it into short chunks, transcribes each chunk with OpenAI, and writes a
single text file.

## Requirements

- Python 3.13+
- `ffmpeg`
- `OPENAI_API_KEY` in your environment

## Installation

From PyPI:

```bash
pip install nanovt
```

Or install it as an isolated `uv` tool:

```bash
uv tool install nanovt
```

## Usage

```bash
nanovt input.mp4
```

By default, `input.mp4` writes `input.txt`.

To force a language, pass an optional language code. For example, English:

```bash
nanovt input.mp4 --language en
```

If `--language` is omitted, the model detects the language automatically.

Other useful options:

```bash
nanovt input.mp4 --chunk-seconds 180 --retries 3
nanovt input.mp4 --output transcript.txt
nanovt input.mp4 --keep-temp
```

For two-speaker dialogue transcription, enable speaker labels:

```bash
nanovt input.mp4 --diarize
```

This uses `gpt-4o-transcribe-diarize` by default and writes dialogue lines such
as `A: ...` and `B: ...`.

## Development

```bash
uv sync --group dev
uv run pytest
uv run nanovt input.mp4
```

## Releasing

Before the first release, confirm:

- The PyPI distribution name `nanovt` is available.
- The repository, homepage, and issue tracker URLs.
- PyPI Trusted Publishing is configured for this repository, workflow
  `publish.yml`, and environment `pypi`.

Bump the version in `pyproject.toml`, then build and check locally:

```bash
uv build
uvx twine check dist/*
```

Commit the version bump, tag the release, and push the tag:

```bash
git tag v0.1.0
git push origin v0.1.0
```

The `Publish` GitHub Actions workflow builds, verifies, and publishes the
release to PyPI through Trusted Publishing. Approve the `pypi` environment if
reviewers are configured.
