Metadata-Version: 2.4
Name: summscriber
Version: 0.8.2
Summary: Transcribe audio with Whisper (faster-whisper), with summarization (pysummarization, sumy, OpenAI) and short reply with OpenAI.
License: GPL-3.0-or-later
Project-URL: Repository, https://github.com/pablogventura/summscriber
Project-URL: Homepage, https://github.com/pablogventura/summscriber
Keywords: whisper,transcription,speech-to-text,summarization,openai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: faster-whisper>=1.0.0
Requires-Dist: pysummarization>=1.1.0
Requires-Dist: sumy>=0.11.0
Requires-Dist: openai>=1.0.0
Requires-Dist: rake-nltk>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Provides-Extra: publish
Requires-Dist: build>=1.0; extra == "publish"
Requires-Dist: twine>=5.0; extra == "publish"
Dynamic: license-file

# Summscriber

Transcribe audio with [faster-whisper](https://github.com/SYSTRAN/faster-whisper) (Whisper), with summarization options (pysummarization, sumy, OpenAI) and short reply generation via OpenAI API.

**Repository:** [github.com/pablogventura/summscriber](https://github.com/pablogventura/summscriber)

## Installation

### With pipx (recommended: isolated env, global command)

```bash
pipx install git+https://github.com/pablogventura/summscriber.git
```

To upgrade:

```bash
pipx upgrade summscriber
```

### With pip (from project directory)

```bash
pip install .
```

Or in editable mode (development):

```bash
pip install -e .
```

Or from the repository:

```bash
pip install git+https://github.com/pablogventura/summscriber.git
```

Or from PyPI (once published):

```bash
pip install summscriber
```

## Usage

After installing, the `summscriber` command is available:

```bash
summscriber FILE [options]
```

Examples:

```bash
summscriber recording.mp3
summscriber interview.ogg --reply
summscriber audio.wav --reply --json
summscriber audio.wav --no-summary
```

### Main options

- **FILE**: audio file to transcribe (required).
- Summarization is **on by default**: OpenAI if configured, otherwise the shortest of pysummarization and sumy.
- `--no-summary`: do not generate a summary (transcription only, or with `--reply`/`--json` if you pass those).
- `--summary-pysummarization` / `--summary-sumy` / `--summary-openai`: also print a summary from a specific backend.
- `--summary-sentences N`: number of sentences in the summary (default 3).
- `--reply`: generate a short reply to the message with OpenAI.
- `--json`: output as JSON.

For summarization and reply with OpenAI, use a config file or environment variables. Configuration is read from the current directory, then from the user config dir (`~/.config/summscriber/config.ini` on Linux/macOS, `%APPDATA%\summscriber\config.ini` on Windows). See `config.ini.example`. Save your token and URL once (stored in the user config dir so it works from any directory):

```bash
summscriber --save-config --api-key YOUR_TOKEN --base-url https://...
```

### Open .ogg (and other audio) by default with the GUI

You can set **summscriber-gui** as the default application for `.ogg` files (and other audio formats your system associates with it). Then:

1. Download WhatsApp voice messages (or any audio) manually to a folder.
2. Click on an `.ogg` (or associated) file: it will open with the GUI, which transcribes the audio and shows the summary and suggested reply; the reply is copied to the clipboard so you can paste it straight into WhatsApp.

To set it as default: right‑click an `.ogg` file → “Open with” / “Abrir con” → choose **summscriber-gui** → tick “Use as default” / “Usar como predeterminado” (wording depends on your OS). On GNOME you can also use **Settings → Applications → Default applications** (or **Files → File types**).

## Development

From the repo root without installing:

```bash
python -m summscriber FILE [options]
```

## Publishing to PyPI

1. Install build tools: `pip install build twine` (or `pip install ".[publish]"`).
2. Create a PyPI account and an API token at [pypi.org/manage/account/token/](https://pypi.org/manage/account/token/).
3. From the project root run:

   ```bash
   ./publish.sh
   ```

   Or manually:

   ```bash
   rm -rf build dist *.egg-info
   python -m build
   twine upload dist/*
   ```

   When prompted, use username `__token__` and password your PyPI token. Or set `TWINE_USERNAME=__token__` and `TWINE_PASSWORD=pypi-your-token`.
