Nakplae
A simple, elegant tool for transcribing videos to SRT subtitles and translating them with minimal dependencies.
Features
- Transcribe video files to SRT subtitles using Whisper locally (multiple model options)
- Support for multilingual content using language-agnostic models (tiny, base, small, medium, large)
- Faster English-specific models available (tiny.en, base.en, small.en, medium.en)
- GPU acceleration for maximum performance (CUDA and Apple Silicon MPS support)
- Translate SRT subtitles using Google's Gemini 2.0 Flash model
- Supports translation to any language (defaults to Thai)
- Real-time Whisper progress output for better visibility
- Simple command-line interface
- Minimal dependencies
Installation
Setup Environment
-
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install the package:
# Installation from PyPI (includes GPU support by default) pip install nakplae
For developers:
# Clone the repository git clone https://github.com/elimydlarz/nakplae.git cd nakplae # Install in development mode pip install -e ".[dev]"
Prerequisites
-
Ensure you have FFmpeg installed (required by Whisper)
- On macOS:
brew install ffmpeg - On Ubuntu:
sudo apt install ffmpeg - On Windows: Download from the official website or use chocolatey
- On macOS:
-
For local LLM translation (optional):
- Install llama.cpp and ensure
llamais in your PATH
- Install llama.cpp and ensure
-
For Gemini translation:
- Set
GEMINI_API_KEYenvironment variable with your API key:export GEMINI_API_KEY=your_api_key_here
- Uses the Gemini 2.0 Flash model for translations with improved rate limiting
- Set
Usage
After installation, you can use the nakplae command directly:
# Basic usage (translates to Thai by default)
nakplae video_file.mp4
# Translate to a different language
nakplae video_file.mp4 --lang "Spanish"
# Only transcribe, don't translate
nakplae video_file.mp4 --transcribe-only
# Specify output directory
nakplae video_file.mp4 --lang "French" --output /path/to/output
# Use a faster model for multilingual content
nakplae video_file.mp4 --model tiny
# Use English-specific model for faster English transcription
nakplae video_file.mp4 --model small.en
# Use a more accurate model for important content
nakplae video_file.mp4 --model medium
If you installed in development mode, you can also run:
python -m nakplae video_file.mp4 --lang "Spanish"
The program will automatically use GPU acceleration if available (CUDA on NVIDIA GPUs or MPS on Apple Silicon).
Development
# Run tests
pytest
# Format code
black .
# Run linter
ruff check .
# Run type checker
mypy nakplae
Publishing
To publish a new release to PyPI:
# 1. Update version in pyproject.toml
# 2. Build the package
python -m build
# 3. Upload to PyPI (requires API token)
python -m twine upload dist/*X.Y.Z* -u __token__ -p $PYPI_API_TOKEN
Project Structure
nakplae/
├── nakplae/
│ ├── __init__.py
│ ├── __main__.py
│ ├── transcribe.py
│ └── translate.py
├── tests/
├── pyproject.toml
├── requirements.txt
└── requirements-dev.txt
License
MIT
Metadata
Release files for nakplae 1.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nakplae-1.1.4.tar.gz | 12.2 kB | Without provenance | Details for nakplae-1.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nakplae-1.1.4-py3-none-any.whl | Python 3 | none | any | Details for nakplae-1.1.4-py3-none-any.whl |
Total release size: 22.8 kB
Release files / nakplae-1.1.4.tar.gz
| Download URL | nakplae-1.1.4.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c38a0368a236cd782a288b1206517cd8f77137d8d2c00a4e92ba9653c16a489
|
|
BLAKE2b-256 checksum How to use checksums |
8d160a68406b6ec9b932b47de462274c68c2ca5f0683322973f86790919ee4bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / nakplae-1.1.4-py3-none-any.whl
| Download URL | nakplae-1.1.4-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
112b396813fd1f7b49ffcf2e96b56215f73dacbeba34c04debb33e2d6aaa95fd
|
|
BLAKE2b-256 checksum How to use checksums |
db190af113d7f91040594cc8df64a11a52c817109a65b1de3071f9b16e5aba90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for nakplae 1.1.4
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.