CLI that turns raw transcripts into study-ready Markdown, DOCX, or LaTeX using OpenAI or Claude.
Project description
t2md
Turn raw transcripts into study-ready reading.
t2md is a command-line tool that takes a folder of transcripts (lecture captions, interview notes, Zoom dumps) and runs them through an LLM to produce a clean executive summary plus textbook-style prose. It auto-picks a cheap model for short inputs and a stronger one for long inputs, and it works with either OpenAI or Anthropic.
Why not just paste into ChatGPT? t2md handles batches of files, concatenates multi-part transcripts, picks the right model for the input size so you don't overpay, and writes consistent Markdown / DOCX / LaTeX you can commit, diff, and re-run on updated source.
What it does
Input — raw transcript (examples/mit6_7960_lec01_intro_deep_learning/mit6_7960f24_lec01.txt):
MITOCW | mit6_7960f24_lec01.mp4
[SQUEAKING]
[RUSTLING]
SARA BEERY:
So why are we all here? Deep learning has clearly been exploding in society. Machine learning
generally is something that, when I started studying it about 13 years ago, didn't work, and
now it works. So how many of you here in this room used AI in the last week?
Yeah, almost everybody, probably everybody...
Output — generated markdown (full file):
# Executive Summary
- Thesis: Deep learning has rapidly evolved to become a transformative technology...
- Key Concepts: neural networks, differential programming, activation functions...
- What to Remember: ReLU is the default activation; transfer learning leverages...
# Reading
## Introduction to Deep Learning
Deep learning has gained significant traction over recent years...
## Historical Perspective on Neural Networks
The journey of neural networks is marked by cycles of enthusiasm and skepticism...
Two pre-generated samples are committed at examples/sample_outputs/ so you can see the output quality before running anything.
Install
pipx install t2md
Or with plain pip:
pip install t2md
For PDF input support:
pipx install "t2md[pdf]"
If you want to install from source:
brew install pipx && pipx ensurepath
pipx install git+https://github.com/rraj7/t2md.git
Verify:
t2md --help
t2md doctor
Setup
Export at least one API key:
export OPENAI_API_KEY="sk-..." # or
export ANTHROPIC_API_KEY="sk-ant-..."
Reload your shell (source ~/.zshrc) and run t2md doctor to confirm.
Usage
# Basic run — auto-selects model by input size, writes Markdown to ./outputs
t2md run examples/mit6_7960_lec01_intro_deep_learning
# Word document output (openable in Word, Google Docs, Pages)
t2md run /path/to/transcripts --format docx
# LaTeX output for PDF-ready workflows
t2md run /path/to/transcripts --format tex
# Use Claude instead of OpenAI
t2md run /path/to/transcripts --provider anthropic
# Override the auto-selected model
t2md run /path/to/transcripts --model gpt-4o
# Use a built-in prompt preset (lecture or interview)
t2md run /path/to/transcripts --preset lecture
t2md run /path/to/transcripts --preset interview
# Custom prompt file — full control over the output style
t2md run /path/to/transcripts --prompt /path/to/prompt_rules.md
# Custom output directory
t2md run /path/to/transcripts --out ~/Documents/t2md_outputs
# Raise the output cap if the generated file looks truncated
t2md run /path/to/transcripts --max-output-tokens 32000
Automatic model selection
Without --model, t2md picks the cheapest model that can handle the input:
| Input tokens | OpenAI | Anthropic |
|---|---|---|
| < 4,000 | gpt-4o-mini |
claude-haiku-4-5 |
| 4,000 – 32,000 | gpt-4o |
claude-sonnet-4-6 |
| > 32,000 | gpt-4o + warning |
claude-sonnet-4-6 + warning |
A typical 60-minute lecture transcript (~15k tokens) runs through gpt-4o for roughly $0.05–$0.10. A short 10-minute clip on gpt-4o-mini is under a cent. Claude costs are in the same ballpark at the matching tier.
Output
All transcripts in a folder are concatenated and summarized into a single output file named <folder>_All.<ext>. Each output contains:
- Executive Summary — thesis, 5–10 key concepts, examples, what to remember
- Structured Reading — textbook-style prose with TOC, headings, and a synthesis
For example, running on a folder named module_03/ produces:
outputs/
module_03_All.md
module_03_All.docx
module_03_All.tex
Design philosophy
- Opinionated defaults, flexible overrides — sensible output for zero config, full control when you need it
- Prompt-first — the transformation rules live in a Markdown file you can edit
- Clean secret handling — API keys come from environment variables, never commands or code
- Extensible — provider abstraction (see
src/t2md/providers.py) makes it easy to add Ollama, Gemini, etc.
Roadmap
Supported input formats today: .txt, .md, .srt, .vtt, .pdf, .docx.
- Local Ollama provider (scaffolding already in place)
- Additional prompt presets (meeting notes, research papers, book chapters)
- YouTube VTT / auto-caption ingestion
- CSV / PPTX input
Contributing
Architecture is settled enough to use day-to-day but open enough that contributions can still shape direction. Issues, PRs, and ideas welcome — especially around new input formats and prompt presets.
License
MIT. Example transcripts in examples/ are MIT OCW content licensed under CC BY-NC-SA 4.0 — see examples/README.md for attribution.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file t2md-0.2.2.tar.gz.
File metadata
- Download URL: t2md-0.2.2.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b131ce23a3aa9d1d3b5de9cf944221449c8cb2cddec8002e95645a4322e1440
|
|
| MD5 |
ac875063ae319f142bee69ae22e75684
|
|
| BLAKE2b-256 |
446b9a11c4e10ebed67d4b5b111d45a7a9dfa32813b06fbec24ea61db5087577
|
Provenance
The following attestation bundles were made for t2md-0.2.2.tar.gz:
Publisher:
publish.yml on rraj7/t2md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
t2md-0.2.2.tar.gz -
Subject digest:
5b131ce23a3aa9d1d3b5de9cf944221449c8cb2cddec8002e95645a4322e1440 - Sigstore transparency entry: 1340540257
- Sigstore integration time:
-
Permalink:
rraj7/t2md@69178430fdb3db6ddadcf67b942e8b792c06ecae -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/rraj7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@69178430fdb3db6ddadcf67b942e8b792c06ecae -
Trigger Event:
push
-
Statement type:
File details
Details for the file t2md-0.2.2-py3-none-any.whl.
File metadata
- Download URL: t2md-0.2.2-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b22a22f1ba1f3a6fd15bbd86b2423cbe269afc0594a6545861f27735b8cabe6
|
|
| MD5 |
07c56290415e5bdd4a53e3abc2efd6da
|
|
| BLAKE2b-256 |
d9fb3919a7984c3c0add39c9776a6822a8e6312bfe06369026a5b717c72756bd
|
Provenance
The following attestation bundles were made for t2md-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on rraj7/t2md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
t2md-0.2.2-py3-none-any.whl -
Subject digest:
0b22a22f1ba1f3a6fd15bbd86b2423cbe269afc0594a6545861f27735b8cabe6 - Sigstore transparency entry: 1340540283
- Sigstore integration time:
-
Permalink:
rraj7/t2md@69178430fdb3db6ddadcf67b942e8b792c06ecae -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/rraj7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@69178430fdb3db6ddadcf67b942e8b792c06ecae -
Trigger Event:
push
-
Statement type: