Metadata-Version: 2.4
Name: youtube-ai-resume
Version: 0.0.5
Summary: CLI & library that extracts YouTube captions and returns an OpenAI-generated summary
Author-email: Fábio Berbert de Paula <fberbert@gmail.com>
License: MIT
License-File: LICENCE
Requires-Python: >=3.9
Requires-Dist: beautifulsoup4>=4.12
Requires-Dist: google-cloud-texttospeech>=2.16
Requires-Dist: openai>=1.15
Requires-Dist: playsound>=1.3
Requires-Dist: prompt-toolkit>=3.0
Requires-Dist: protobuf<4,>=3.20
Requires-Dist: requests>=2.32
Requires-Dist: rich>=13.7
Requires-Dist: youtube-transcript-api
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Description-Content-Type: text/markdown

youtube-ai-resume dQw4w9WgXcQ     # Rick Astley demo 😄
txt = caption.fetch_caption("dQw4w9WgXcQ")

# youtube-ai-resume

**Generate concise AI summaries of YouTube videos from the command line.**  
It works in two steps:

1. Downloads the video caption (subtitles) with `pytubefix`.
2. Sends the caption to the OpenAI API and returns a summary in the language you choose.

<p align="center">
  <img src="https://img.shields.io/pypi/v/youtube-ai-resume?color=brightgreen" alt="PyPI">
  <img src="https://img.shields.io/pypi/pyversions/youtube-ai-resume" alt="Python Version">
  <img src="https://img.shields.io/github/license/your-user/youtube-ai-resume" alt="License">
</p>

---

## Features

* **Zero-setup CLI** → `youtube-ai-resume <video_id>`
* Summaries in any language (default `pt_BR`)
* Works with models like **`gpt-4.1-mini`** (configurable)
* Rich-formatted output with colours
* Usable as a *library* (`import youtube_ai_resume`)

---

## Installation

```bash
# Python ≥ 3.9
pip install youtube-ai-resume
```

Or, from source for development:

```bash
git clone https://github.com/fberbert/youtube-ai-resume.git
cd youtube-ai-resume
pip install -e ".[dev]"     # editable + dev tools
```

## Quick start

### Command Line Usage

```bash
export OPENAI_API_KEY="sk-..."
youtube-ai-resume dQw4w9WgXcQ     # Rick Astley demo 😄
```

Sample output:

```plaintext
Summary:

• Rick distances himself from breaking promises
• Emphasises commitment (“never gonna give you up…”) …
```

### Library usage

```python
from youtube_ai_resume import caption, summarizer

txt = caption.fetch_caption("dQw4w9WgXcQ")
summary = summarizer.summarize(
    transcript=txt,
    api_key="sk-…",
    model="gpt-4.1-mini",
    out_lang="en"
)
print(summary)
```

## Configuration


## Voice narration (Text-to-Speech) [Optional]

You can optionally have the summary narrated aloud using Google Cloud Text-to-Speech (TTS).

### Optional Requirements (only if you want voice narration)

- A Google Cloud account with the Text-to-Speech API enabled
- A service account key (JSON) with permission to use TTS
- The dependencies `google-cloud-texttospeech` and `playsound` (already included in requirements.txt)

### Optional Setup

1. Create a project in Google Cloud and enable the Text-to-Speech API.
2. Generate and download a service account credentials file (JSON).
3. Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of your credentials file:

```bash
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account.json"
```

Or authenticate using the Google Cloud CLI (`gcloud`):

```bash
gcloud auth application-default login
```

### Usage

- To hear the summary narration, add the `--voice` option to the command:

```bash
youtube-ai-resume dQw4w9WgXcQ --voice
```

- To enable narration by default, add to your config.json:

```json
{
    "voice_enabled": true
}
```

You can customize voice, language, and speed in config.json (see code examples).

---

You can set the OpenAI API key as an environment variable or in a config file.

Environment variable:

```bash
OPENAI_API_KEY="sk-..."
```

Config file at ~/.config/youtube-ai-resume/config.json (auto-created on first run) lets you change the default model.

```json
{
    "model": "gpt-4.1-mini",
    "out_lang": "en"
}
```

## Development

Contributions are welcome!

Fork ➜ branch ➜ PR.

ruff check . and pytest must pass.

Describe your change clearly.

## License

Released under the MIT License – see LICENSE.
