captionkit 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug in CaptionKit
4
+ title: "[Bug] "
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Describe the bug
10
+
11
+ A clear and concise description of what went wrong.
12
+
13
+ ## To reproduce
14
+
15
+ Steps to reproduce the behavior:
16
+
17
+ 1. Run `captionkit ...`
18
+ 2. With file type / language ...
19
+ 3. See error
20
+
21
+ ## Expected behavior
22
+
23
+ What you expected to happen.
24
+
25
+ ## Environment
26
+
27
+ - OS: [e.g. Ubuntu 22.04, macOS 14, Windows 11]
28
+ - Python version: [e.g. 3.12]
29
+ - CaptionKit version: [e.g. 0.1.0]
30
+ - Device: [CPU / CUDA / Apple Silicon]
31
+ - ffmpeg version (if relevant): [e.g. 6.1]
32
+
33
+ ## Logs / error output
34
+
35
+ ```
36
+ Paste any error output here
37
+ ```
38
+
39
+ ## Additional context
40
+
41
+ Add any other context (sample file, screenshots, etc.).
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest an idea for CaptionKit
4
+ title: "[Feature] "
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Problem
10
+
11
+ What problem does this solve? Is it related to a frustration?
12
+
13
+ ## Proposed solution
14
+
15
+ Describe the feature you'd like.
16
+
17
+ ## Alternatives considered
18
+
19
+ Any alternative solutions or features you've thought about.
20
+
21
+ ## Additional context
22
+
23
+ Anything else — screenshots, links, examples.
@@ -0,0 +1,14 @@
1
+ ## What does this PR do?
2
+
3
+ <!-- Describe the change and why it's needed. -->
4
+
5
+ ## How to test
6
+
7
+ <!-- Steps to verify the change works. -->
8
+
9
+ ## Checklist
10
+
11
+ - [ ] Tests pass (`pytest`)
12
+ - [ ] Linting passes (`ruff check src/ tests/`)
13
+ - [ ] Added/updated tests for new functionality
14
+ - [ ] Updated README or docs if needed
@@ -0,0 +1,37 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: actions/setup-python@v5
15
+ with:
16
+ python-version: "3.12"
17
+ - name: Install ruff
18
+ run: pip install ruff
19
+ - name: Lint
20
+ run: ruff check src/ tests/
21
+ - name: Format check
22
+ run: ruff format --check src/ tests/
23
+
24
+ test:
25
+ runs-on: ubuntu-latest
26
+ strategy:
27
+ matrix:
28
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: ${{ matrix.python-version }}
34
+ - name: Install dependencies
35
+ run: pip install -e ".[dev]"
36
+ - name: Run tests
37
+ run: pytest -v --tb=short
@@ -0,0 +1,51 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ id-token: write
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.12"
19
+
20
+ - name: Install build tools
21
+ run: pip install build
22
+
23
+ - name: Build sdist and wheel
24
+ run: python -m build
25
+
26
+ - name: Verify distributions
27
+ run: |
28
+ pip install twine
29
+ twine check dist/*
30
+
31
+ - name: Upload build artifacts
32
+ uses: actions/upload-artifact@v4
33
+ with:
34
+ name: dist
35
+ path: dist/
36
+
37
+ publish:
38
+ needs: build
39
+ runs-on: ubuntu-latest
40
+ environment: pypi
41
+ permissions:
42
+ id-token: write
43
+ steps:
44
+ - name: Download build artifacts
45
+ uses: actions/download-artifact@v4
46
+ with:
47
+ name: dist
48
+ path: dist/
49
+
50
+ - name: Publish to PyPI
51
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,21 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ *.egg
8
+ .pytest_cache/
9
+ .ruff_cache/
10
+ .venv/
11
+ venv/
12
+ *.mp4
13
+ *.mp3
14
+ *.wav
15
+ *.srt
16
+ *.vtt
17
+ *.ass
18
+ *.json
19
+ !pyproject.toml
20
+ !assets/*.gif
21
+ .DS_Store
@@ -0,0 +1,32 @@
1
+ # Changelog
2
+
3
+ All notable changes to CaptionKit will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2026-11-28
9
+
10
+ ### Added
11
+
12
+ - `captionkit transcribe` command — transcribe video/audio to SRT, VTT, ASS, and JSON with word-level timestamps
13
+ - Auto-detect language from 90+ Whisper-supported languages, with `--language` override
14
+ - `--translate` flag to translate output to English
15
+ - Model size selection: tiny, base, small, medium, large-v3
16
+ - CPU and CUDA device support with auto-detection
17
+ - `captionkit burn` command — burn styled ASS captions into video via ffmpeg
18
+ - 8 burn presets: clean, minimal, shorts, shorts-karaoke, reels, reels-karaoke, tiktok, tiktok-karaoke
19
+ - Word-by-word karaoke highlight mode for 9:16 short-form video
20
+ - Custom font, size, color, position, and max-chars overrides for burn
21
+ - RTL and CJK font fallback support
22
+ - `captionkit batch` command — process all media files in a folder (transcribe or burn mode)
23
+ - `captionkit presets` command — list all available burn presets
24
+ - VAD (Voice Activity Detection) filter for cleaner transcription
25
+ - 58 unit tests with mocked Whisper (runs in ~0.1s)
26
+ - GitHub Actions CI: lint + test matrix across Python 3.9–3.13
27
+ - PyPI release workflow with Trusted Publishing
28
+ - README with install guide, demos, examples, and language support tables
29
+ - CONTRIBUTING.md, CODE_OF_CONDUCT.md, ROADMAP.md
30
+ - Issue and PR templates
31
+
32
+ [0.1.0]: https://github.com/abubakar60675/captionkit/releases/tag/v0.1.0
@@ -0,0 +1,63 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies within all community spaces, and also applies when
49
+ an individual is officially representing the community in public spaces.
50
+
51
+ ## Enforcement
52
+
53
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
54
+ reported to the project maintainers. All complaints will be reviewed and
55
+ investigated promptly and fairly.
56
+
57
+ ## Attribution
58
+
59
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
60
+ version 2.0, available at
61
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
62
+
63
+ [homepage]: https://www.contributor-covenant.org
@@ -0,0 +1,69 @@
1
+ # Contributing to CaptionKit
2
+
3
+ Thanks for your interest in contributing! CaptionKit is a community project and every contribution makes captions more accessible to creators worldwide.
4
+
5
+ ## Getting started
6
+
7
+ 1. Fork the repository and clone your fork
8
+ 2. Create a virtual environment:
9
+ ```bash
10
+ python -m venv .venv
11
+ source .venv/bin/activate # or .venv\Scripts\activate on Windows
12
+ ```
13
+ 3. Install in development mode:
14
+ ```bash
15
+ pip install -e ".[dev]"
16
+ ```
17
+ 4. Run tests to make sure everything works:
18
+ ```bash
19
+ pytest -v
20
+ ```
21
+
22
+ ## Development workflow
23
+
24
+ 1. Create a branch for your work:
25
+ ```bash
26
+ git checkout -b my-feature
27
+ ```
28
+ 2. Make your changes with clear commit messages
29
+ 3. Run the linter and tests:
30
+ ```bash
31
+ ruff check src/ tests/
32
+ ruff format src/ tests/
33
+ pytest -v
34
+ ```
35
+ 4. Push your branch and open a pull request
36
+
37
+ ## Code style
38
+
39
+ - We use [ruff](https://docs.astral.sh/ruff/) for linting and formatting
40
+ - Add type hints to all function signatures
41
+ - Write docstrings for public functions
42
+ - Keep functions focused — one function, one job
43
+
44
+ ## Testing
45
+
46
+ - All new features need tests
47
+ - Mock external dependencies (Whisper models, ffmpeg) so tests run fast
48
+ - Use `pytest` fixtures for shared test data (see `tests/conftest.py`)
49
+
50
+ ## Areas where help is welcome
51
+
52
+ Check the [ROADMAP](ROADMAP.md) for planned features and look for issues labeled [`good first issue`](../../labels/good%20first%20issue).
53
+
54
+ Some beginner-friendly areas:
55
+ - Adding more burn presets
56
+ - Improving documentation and examples
57
+ - Adding support for more output formats
58
+ - Writing integration tests with short audio clips
59
+
60
+ ## Reporting bugs
61
+
62
+ Please use the [bug report template](../../issues/new?template=bug_report.md) and include:
63
+ - Your OS, Python version, and CaptionKit version
64
+ - The command you ran
65
+ - The full error output
66
+
67
+ ## Code of Conduct
68
+
69
+ This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to uphold it.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Muhammad Abubakar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,226 @@
1
+ Metadata-Version: 2.5
2
+ Name: captionkit
3
+ Version: 0.1.0
4
+ Summary: Local-first CLI that makes accurate captions for any video or audio in 90+ languages with Whisper — no cloud, no paid APIs.
5
+ Project-URL: Homepage, https://github.com/abubakar60675/captionkit
6
+ Project-URL: Repository, https://github.com/abubakar60675/captionkit
7
+ Project-URL: Issues, https://github.com/abubakar60675/captionkit/issues
8
+ Project-URL: Changelog, https://github.com/abubakar60675/captionkit/blob/main/CHANGELOG.md
9
+ Author: Muhammad Abubakar
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: accessibility,ass,audio,captions,srt,subtitles,transcription,video,vtt,whisper
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: End Users/Desktop
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
24
+ Classifier: Topic :: Multimedia :: Video
25
+ Requires-Python: >=3.10
26
+ Requires-Dist: click>=8.1
27
+ Requires-Dist: faster-whisper>=1.0.0
28
+ Requires-Dist: rich>=13.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
31
+ Requires-Dist: pytest>=7.0; extra == 'dev'
32
+ Requires-Dist: ruff>=0.4; extra == 'dev'
33
+ Description-Content-Type: text/markdown
34
+
35
+ # CaptionKit
36
+
37
+ **Local-first CLI that makes accurate captions for any video or audio in 90+ languages with Whisper — no cloud, no paid APIs.**
38
+
39
+ CaptionKit runs entirely on your machine. Your media never leaves your computer. It uses [faster-whisper](https://github.com/SYSTRAN/faster-whisper) for transcription and ffmpeg for burning captions into video — both free and open source.
40
+
41
+ <p align="center">
42
+ <img src="https://raw.githubusercontent.com/abubakar60675/captionkit/main/assets/demo-terminal.gif" alt="CaptionKit terminal demo" width="700">
43
+ </p>
44
+
45
+ <p align="center">
46
+ <img src="https://raw.githubusercontent.com/abubakar60675/captionkit/main/assets/demo-burn.gif" alt="CaptionKit karaoke burn demo" width="280">
47
+ </p>
48
+
49
+ ## Why CaptionKit?
50
+
51
+ - **Free forever** — no API keys, no subscriptions, no usage limits
52
+ - **Private** — your files never leave your machine
53
+ - **Offline** — works without an internet connection (after model download)
54
+ - **Accurate** — powered by OpenAI's Whisper model via faster-whisper
55
+ - **90+ languages** — auto-detects the language or use `--language` to specify
56
+ - **Multiple formats** — outputs SRT, VTT, ASS, and JSON with word-level timestamps
57
+ - **Burn captions into video** — styled presets for YouTube Shorts, Reels, TikTok
58
+ - **Karaoke mode** — word-by-word highlight captions for short-form content
59
+ - **RTL and CJK support** — proper rendering for Arabic, Hebrew, Chinese, Japanese, Korean
60
+ - **Batch processing** — caption an entire folder in one command
61
+
62
+ ## Install
63
+
64
+ Requires Python 3.10+ and ffmpeg.
65
+
66
+ ```bash
67
+ # Install ffmpeg (if not already installed)
68
+ # macOS: brew install ffmpeg
69
+ # Ubuntu: sudo apt install ffmpeg
70
+ # Windows: https://ffmpeg.org/download.html
71
+
72
+ # Install from PyPI
73
+ pip install captionkit
74
+
75
+ # Or with pipx (isolated install)
76
+ pipx install captionkit
77
+ ```
78
+
79
+ For GPU acceleration (optional):
80
+
81
+ ```bash
82
+ # NVIDIA CUDA
83
+ pip install captionkit ctranslate2 nvidia-cublas-cu12 nvidia-cudnn-cu12
84
+ ```
85
+
86
+ ## Quick start
87
+
88
+ ### Transcribe a file
89
+
90
+ ```bash
91
+ # Auto-detect language, output SRT + VTT + ASS + JSON
92
+ captionkit transcribe video.mp4
93
+
94
+ # Specify language
95
+ captionkit transcribe podcast.mp3 --language en
96
+
97
+ # Use a larger model for better accuracy
98
+ captionkit transcribe interview.wav --model large-v3
99
+
100
+ # Translate to English
101
+ captionkit transcribe video_french.mp4 --translate
102
+ ```
103
+
104
+ ### Burn captions into video
105
+
106
+ ```bash
107
+ # Clean captions for landscape video
108
+ captionkit burn video.mp4
109
+
110
+ # TikTok-style with karaoke highlighting
111
+ captionkit burn video.mp4 --preset tiktok-karaoke
112
+
113
+ # YouTube Shorts preset
114
+ captionkit burn video.mp4 --preset shorts
115
+
116
+ # Custom styling
117
+ captionkit burn video.mp4 --font "Noto Sans" --font-size 28 --position top
118
+ ```
119
+
120
+ ### Batch process a folder
121
+
122
+ ```bash
123
+ # Transcribe all media files in a folder
124
+ captionkit batch ./videos/ --mode transcribe
125
+
126
+ # Burn captions into all videos with Reels preset
127
+ captionkit batch ./videos/ --mode burn --preset reels-karaoke
128
+ ```
129
+
130
+ ### List available presets
131
+
132
+ ```bash
133
+ captionkit presets
134
+ ```
135
+
136
+ ## Presets
137
+
138
+ | Preset | Aspect | Karaoke | Use case |
139
+ |--------|--------|---------|----------|
140
+ | `clean` | 16:9 | No | Standard landscape video |
141
+ | `minimal` | 16:9 | No | Low-profile captions |
142
+ | `shorts` | 9:16 | No | YouTube Shorts |
143
+ | `shorts-karaoke` | 9:16 | Yes | YouTube Shorts with word highlighting |
144
+ | `reels` | 9:16 | No | Instagram Reels |
145
+ | `reels-karaoke` | 9:16 | Yes | Instagram Reels with word highlighting |
146
+ | `tiktok` | 9:16 | No | TikTok |
147
+ | `tiktok-karaoke` | 9:16 | Yes | TikTok with word highlighting |
148
+
149
+ ## Model sizes
150
+
151
+ | Model | Parameters | English | Multilingual | Speed | VRAM |
152
+ |-------|-----------|---------|-------------|-------|------|
153
+ | `tiny` | 39M | Good | Okay | Fastest | ~1 GB |
154
+ | `base` | 74M | Good | Good | Fast | ~1 GB |
155
+ | `small` | 244M | Great | Good | Moderate | ~2 GB |
156
+ | `medium` | 769M | Great | Great | Slow | ~5 GB |
157
+ | `large-v3` | 1550M | Best | Best | Slowest | ~10 GB |
158
+
159
+ Default is `base` — a good balance of speed and accuracy. Use `tiny` for quick drafts, `large-v3` for final production.
160
+
161
+ ## Language support
162
+
163
+ CaptionKit supports 90+ languages through Whisper, including but not limited to:
164
+
165
+ **Latin script:** English, Spanish, French, German, Portuguese, Italian, Dutch, Polish, Turkish, Vietnamese, Indonesian, Malay, Swahili, and many more
166
+
167
+ **Arabic script:** Arabic, Urdu, Persian, Pashto
168
+
169
+ **CJK:** Chinese (Simplified & Traditional), Japanese, Korean
170
+
171
+ **Devanagari:** Hindi, Marathi, Sanskrit, Nepali
172
+
173
+ **Other scripts:** Thai, Greek, Russian, Ukrainian, Georgian, Armenian, Hebrew, Bengali, Tamil, Telugu, Kannada, Malayalam, Burmese, Khmer, Lao
174
+
175
+ Language is auto-detected by default. Use `--language <code>` to specify (e.g., `--language ar` for Arabic, `--language zh` for Chinese).
176
+
177
+ ### RTL and CJK rendering
178
+
179
+ When burning captions, CaptionKit uses font fallback to find appropriate fonts for the detected script. For best results with RTL or CJK content, install [Noto fonts](https://fonts.google.com/noto):
180
+
181
+ ```bash
182
+ # Ubuntu/Debian
183
+ sudo apt install fonts-noto fonts-noto-cjk fonts-noto-color-emoji
184
+
185
+ # macOS (via Homebrew)
186
+ brew install font-noto-sans font-noto-sans-cjk
187
+ ```
188
+
189
+ ## Output formats
190
+
191
+ | Format | Extension | Word timestamps | Use case |
192
+ |--------|-----------|----------------|----------|
193
+ | SRT | `.srt` | Segment-level | Most video players and editors |
194
+ | WebVTT | `.vtt` | Segment-level | Web video, HTML5 `<track>` |
195
+ | ASS | `.ass` | Word-level (karaoke) | Advanced styling, burning |
196
+ | JSON | `.json` | Word-level | Programmatic access, custom tools |
197
+
198
+ ## Development
199
+
200
+ ```bash
201
+ git clone https://github.com/abubakar60675/captionkit.git
202
+ cd captionkit
203
+ python -m venv .venv
204
+ source .venv/bin/activate
205
+ pip install -e ".[dev]"
206
+
207
+ # Run tests
208
+ pytest -v
209
+
210
+ # Lint
211
+ ruff check src/ tests/
212
+ ```
213
+
214
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the full contribution guide.
215
+
216
+ ## Changelog
217
+
218
+ See [CHANGELOG.md](CHANGELOG.md) for release history.
219
+
220
+ ## Roadmap
221
+
222
+ See [ROADMAP.md](ROADMAP.md) for planned features and `good first issue` ideas.
223
+
224
+ ## License
225
+
226
+ [MIT](LICENSE) — free for personal and commercial use.