OpenParable
Skip to content
← Back to skills

Gemini Caption Parse

Documents
gemini-caption-parse

Gemini Caption Parse is an Agent Skill for documents published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Parse and write Gemini/YouTube markdown transcript format with timestamps

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/documents/gemini-caption-parse/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/gemini-caption-parse, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Gemini Format Parser Skill

Use this skill to parse and write Gemini-style markdown transcripts.

Installation

# Using uv (recommended)
uv pip install gemini-caption-skills

# Or using pip
pip install gemini-caption-skills

Reading Transcripts

Parse All Segments

from gemini_caption import GeminiReader

# From file
segments = GeminiReader.read("transcript.md", include_events=True, include_sections=True)

# From string content
segments = GeminiReader.read(markdown_content, include_events=True)

for seg in segments:
    print(f"[{seg.start:.1f}s] {seg.speaker}: {seg.text}")

Extract Dialogue Only

from gemini_caption import GeminiReader

# Returns list of dicts with: text, start, end, speaker, section
dialogue = GeminiReader.extract_dialogue("transcript.md")

for seg in dialogue:
    print(f"{seg['start']:.2f} - {seg['end']:.2f}: {seg['text']}")

GeminiSegment Fields

Each segment has these fields:

  • text: The spoken/event text
  • timestamp: Start time in seconds (or None)
  • end_timestamp: End time in seconds (or None)
  • speaker: Speaker name (e.g., "Mira Murati:")
  • section: Current section title
  • segment_type: "dialogue", "event", or "section_header"
  • line_number: Source line number

Writing Transcripts

Write to File

from gemini_caption import GeminiWriter

segments = [
    {"text": "Welcome everyone.", "start": 0, "end": 2, "speaker": "Host"},
    {"text": "Thank you for having me.", "start": 2, "end": 5, "speaker": "Guest"},
]

GeminiWriter.write_transcript(
    segments,
    "output.md",
    title="My Podcast Episode",
    include_toc=True,
)

Convert to Markdown String

from gemini_caption import GeminiWriter

md = GeminiWriter.to_markdown(segments, title="Episode 1")
print(md)

Supported Formats

Standard Gemini Format

## [00:00:00] Introduction

**Host:** Welcome back to the show. [00:00:01]

**Guest:** Thank you for having me. [00:00:05]

[Applause] [00:00:08]

YouTube Link Format

## [[00:12](http://www.youtube.com/watch?v=xxx&t=12)] Introduction

**Speaker:** Hello everyone [[00:21](http://www.youtube.com/watch?v=xxx&t=21)]

Timestamp Utilities

from gemini_caption import GeminiReader, GeminiWriter

# Parse timestamp to seconds
seconds = GeminiReader.parse_timestamp("01", "30", "45")  # 5445.0

# Format seconds to timestamp
ts = GeminiWriter.format_timestamp(5445.0)  # "[01:30:45]"