A Python tool for processing interview transcripts from VTT files, with automatic speaker labeling and Word document generation. Built with love to help my wonderful wife <3 with her thesis!
- VTT Processing: Parse WebVTT transcript files with timestamp extraction
- Speaker Labeling: Automatically replace speaker names with consistent "Interviewer" and "Interviewee N" labels
- Caption Concatenation: Merge contiguous captions from the same speaker for cleaner output
- Word Document Generation: Create formatted Word documents with simplified timestamps
- Consistent Numbering: Match interviewee numbers to interview numbers (Interview 1 -> Interviewee 1)
This project uses uv for dependency management. Install uv first, then:
git clone <repository-url>
cd interview-processor
uv syncPlace your VTT files in the interviews/ directory structure:
interviews/
├── 01/
│ └── GMT20250616-140650_Recording.transcript.vtt
├── 02/
│ └── GMT20250616-153105_Recording.transcript.vtt
└── ...
Run the transcript processor:
uv run python process_transcripts.pyThis will:
- Read all VTT files from interview folders
- Concatenate contiguous captions from the same speaker
- Replace speaker names with "Interviewer" and "Interviewee N" labels
- Save processed transcripts to
processed/directory
Create a combined Word document from all processed transcripts:
uv run python create_word_document.pyThis generates combined_interviews.docx with:
- Plain text formatting (no styling)
- Simplified timestamps in
[HH:MM:SS]format - "Interview N" titles with page breaks between interviews
- Consistent speaker labeling throughout
interview-processor/
├── process_transcripts.py # VTT processing and speaker labeling
├── create_word_document.py # Word document generation
├── interviews/ # Input VTT files (gitignored)
├── processed/ # Processed transcript files (gitignored)
├── combined_interviews.docx # Output Word document (gitignored)
├── pyproject.toml # Project configuration
├── LICENSE # BSD 3-Clause License
└── README.md # This file
uv sync --devRun the test suite:
# Run all tests
uv run pytest
# Run with verbose output
uv run pytest -v
# Run specific test file
uv run pytest tests/test_process_transcripts.pyThis project uses ruff for linting and formatting:
# Check code
uv run ruff check .
# Format code
uv run ruff format .
# Auto-fix issues
uv run ruff check --fix .- Line length: 119 characters
- Python version: 3.13+
- Import sorting: Enabled via ruff
- Type hints: Modern syntax (
list[dict]instead ofList[Dict])
[00:00:03] Interviewer: Hello, how are you?
[00:00:11] Interviewee 1: I'm good, thank you. How about you?
[00:00:21] Interviewer: I'm doing well, thanks for asking.
- Interview 1 (plain text title)
- Transcript content with timestamps and speaker labels
- Page break
- Interview 2
- ...and so on
- Python 3.13+
- uv package manager
- Dependencies managed via
pyproject.toml
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run code quality checks (
uv run ruff check . && uv run ruff format .) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- The tool assumes the first speaker in each interview is the interviewer
- Interview folders should be numbered (01, 02, 03, etc.)
- VTT files should follow standard WebVTT format
- Generated Word documents use plain text formatting for maximum compatibility