Metadata-Version: 2.2
Name: youtube-transcript-generator
Version: 0.1.1
Summary: A Python package to generate AI-powered transcripts from YouTube videos
Author-email: Manoj Tyagi <tyagimanojtyagi.22@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/thewolfcommander/pulse__youtube-transcript
Project-URL: Documentation, https://github.com/thewolfcommander/pulse__youtube-transcript/docs
Project-URL: Repository, https://github.com/thewolfcommander/pulse__youtube-transcript.git
Project-URL: Issues, https://github.com/thewolfcommander/pulse__youtube-transcript/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Text Processing
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: google-generativeai>=0.3.0
Requires-Dist: yt-dlp>=2024.1.1
Requires-Dist: pydantic>=2.6.0
Requires-Dist: pydantic-settings>=2.1.0
Requires-Dist: typer[all]>=0.9.0
Requires-Dist: rich>=13.7.0
Requires-Dist: loguru>=0.7.2
Requires-Dist: aiohttp>=3.9.1
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: asyncio>=3.4.3
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.5; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: black>=24.1.0; extra == "dev"
Requires-Dist: isort>=5.13.2; extra == "dev"
Requires-Dist: mypy>=1.8.0; extra == "dev"
Requires-Dist: pylint>=3.0.3; extra == "dev"
Requires-Dist: pre-commit>=3.6.0; extra == "dev"
Provides-Extra: interactive
Requires-Dist: ipython>=8.12.0; extra == "interactive"
Requires-Dist: pytest-watch>=4.2.0; extra == "interactive"
Dynamic: requires-python

# README.md
# YouTube Transcript Generator

A powerful, AI-enhanced YouTube transcript generator using Gemini Pro. Generate high-quality transcripts with advanced features like speaker detection, multi-language support, and custom formatting.

## Features

- 🎯 High-accuracy transcription using AI enhancement
- 🌍 Multi-language support with translation capabilities
- 👥 Speaker detection and labeling
- ⏱️ Timestamp preservation and formatting
- 🎨 Custom output formats (TXT, SRT, VTT, JSON, MD)
- 🚀 Async processing for better performance
- 📊 Quality metrics and confidence scoring
- 💾 Caching support for better efficiency
- 🛡️ Comprehensive error handling
- 📝 Detailed logging system

## Installation

```bash
pip install youtube-transcript-generator
```

## Quick Start

```python
from youtube_transcript_generator import TranscriptGenerator

async def main():
    generator = TranscriptGenerator()
    result = await generator.generate_transcript(
        "https://youtube.com/watch?v=your_video_id",
        options=TranscriptionOptions(
            target_language="en",
            enhance_formatting=True
        )
    )
    print(result.transcript)

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())
```

## CLI Usage (COMING SOON)

```bash
# Generate transcript
yt-transcript generate https://youtube.com/watch?v=your_video_id -o transcript.txt

# With options
yt-transcript generate https://youtube.com/watch?v=your_video_id \
    --language es \
    --format srt \
    --timestamps \
    --speakers
```

## Configuration

Create a `.env` file:

```env
GEMINI_API_KEY=your_gemini_api_key
YOUTUBE_API_KEY=your_youtube_api_key  # Optional
DEBUG=False
LOG_LEVEL=INFO
```

## Documentation

Visit our [documentation](docs/README.md) for detailed information.

## Contributing

We welcome contributions! Please see our [contributing guidelines](docs/CONTRIBUTING.md).

## License

MIT License - see [LICENSE](LICENSE) for details.

# API.md
# API Documentation

## Core Components

### TranscriptGenerator

The main class for generating transcripts.

```python
class TranscriptGenerator:
    async def generate_transcript(
        video_url: str,
        options: Optional[TranscriptionOptions] = None
    ) -> TranscriptionResult:
        """Generate transcript for a YouTube video."""
```

### TranscriptionOptions

Configure transcript generation:

```python
class TranscriptionOptions(BaseModel):
    target_language: Optional[str] = None
    enhance_formatting: bool = True
    include_timestamps: bool = False
    detect_speakers: bool = False
    custom_formatting: Optional[dict] = None
```

### VideoInfo

Video information model:

```python
class VideoInfo(BaseModel):
    video_id: str
    title: str
    duration: int
    language: Optional[str]
    captions_available: bool
    url: str
    author: str
    view_count: Optional[int]
    metadata: dict
```

## Error Handling (Exception Classes)

The library defines several exception classes:

- `TranscriptionError`: Base exception
- `ValidationError`: Input validation errors
- `VideoProcessingError`: Video processing failures
- `AIProcessingError`: AI processing issues

## Examples

### Basic Usage

```python
from youtube_transcript_generator import TranscriptGenerator

generator = TranscriptGenerator()
result = await generator.generate_transcript("https://youtube.com/watch?v=...")
print(result.transcript)
```

### Advanced Usage

```python
options = TranscriptionOptions(
    target_language="es",
    enhance_formatting=True,
    include_timestamps=True,
    detect_speakers=True,
    custom_formatting={"format": "srt"}
)

result = await generator.generate_transcript(
    "https://youtube.com/watch?v=...",
    options=options
)
```

### Enhanced Usage

# As a module
```python
runner = TranscriptRunner()
output_files = await runner.process_video(
    "https://youtube.com/watch?v=VIDEO_ID",
    {
        'save_json': True,
        'save_srt': True,
        'save_vtt': True,
        'save_txt': True,
        'include_timestamps': True
    }
)
```

# As command line tool (Need to Build the package locally)
```shell
python runner.py "https://youtube.com/watch?v=VIDEO_ID" \
    --formats json,srt,vtt,txt \
    --timestamps \
    --output-dir my_transcripts
```

# CONTRIBUTING.md
# Contributing Guidelines

## Getting Started

1. Fork the repository
2. Clone your fork
3. Create a virtual environment
4. Install development dependencies

```bash
pip install -e ".[dev]"
```

## Development Process

1. Create a new branch
2. Make your changes
3. Write/update tests
4. Update documentation
5. Submit a pull request

## Code Style

- Follow PEP 8
- Use type hints
- Write docstrings (Google style)
- Keep functions focused and small
- Add comments for complex logic

## Testing (COMING SOON)

Run tests:

```bash
pytest
```

With coverage:

```bash
pytest --cov=youtube_transcript_generator
```

## Documentation

- Update API documentation for new features
- Add examples for new functionality
- Keep README.md up to date

## Pull Request Process

1. Update CHANGELOG.md
2. Ensure tests pass
3. Update documentation
4. Wait for review

# architecture.md
# Architecture Overview

## Core Components

### TranscriptGenerator

The main orchestrator that:
- Coordinates video processing
- Manages AI enhancement
- Handles output formatting

### YouTubeClient

Responsible for:
- Video information retrieval
- Caption downloading
- Format conversion

### AI Processor

Handles:
- Transcript enhancement
- Language processing
- Quality validation

## Data Flow

1. User Input → Video URL
2. URL → Video Information
3. Video → Raw Captions
4. Captions → AI Processing
5. AI Output → Final Transcript

## Design Principles

1. Modularity
   - Separate concerns
   - Pluggable components
   - Easy extensions

2. Robustness
   - Error handling
   - Retry logic
   - Validation

3. Performance
   - Async operations
   - Caching
   - Rate limiting

4. Maintainability
   - Clear structure
   - Documentation
   - Type safety
