graba-reunion 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. graba_reunion-0.5.0/.env.example +35 -0
  2. graba_reunion-0.5.0/.gitignore +22 -0
  3. graba_reunion-0.5.0/AGENTS.md +81 -0
  4. graba_reunion-0.5.0/Makefile +18 -0
  5. graba_reunion-0.5.0/PKG-INFO +144 -0
  6. graba_reunion-0.5.0/README.md +115 -0
  7. graba_reunion-0.5.0/docs/guia-completa.md +684 -0
  8. graba_reunion-0.5.0/pyproject.toml +54 -0
  9. graba_reunion-0.5.0/scripts/pipx-install.sh +20 -0
  10. graba_reunion-0.5.0/scripts/setup.sh +15 -0
  11. graba_reunion-0.5.0/src/graba_reunion/__init__.py +1 -0
  12. graba_reunion-0.5.0/src/graba_reunion/__main__.py +6 -0
  13. graba_reunion-0.5.0/src/graba_reunion/cli.py +238 -0
  14. graba_reunion-0.5.0/src/graba_reunion/commands/__init__.py +1 -0
  15. graba_reunion-0.5.0/src/graba_reunion/commands/check_deps.py +107 -0
  16. graba_reunion-0.5.0/src/graba_reunion/commands/list_show.py +66 -0
  17. graba_reunion-0.5.0/src/graba_reunion/commands/record.py +249 -0
  18. graba_reunion-0.5.0/src/graba_reunion/commands/setup_cmd.py +14 -0
  19. graba_reunion-0.5.0/src/graba_reunion/config.py +384 -0
  20. graba_reunion-0.5.0/src/graba_reunion/db.py +190 -0
  21. graba_reunion-0.5.0/src/graba_reunion/deps_installer.py +75 -0
  22. graba_reunion-0.5.0/src/graba_reunion/enrichment.py +68 -0
  23. graba_reunion-0.5.0/src/graba_reunion/groq_summary.py +230 -0
  24. graba_reunion-0.5.0/src/graba_reunion/paths.py +49 -0
  25. graba_reunion-0.5.0/src/graba_reunion/recording.py +85 -0
  26. graba_reunion-0.5.0/src/graba_reunion/setup_wizard.py +242 -0
  27. graba_reunion-0.5.0/src/graba_reunion/transcription/__init__.py +1 -0
  28. graba_reunion-0.5.0/src/graba_reunion/transcription/faster_whisper.py +40 -0
  29. graba_reunion-0.5.0/src/graba_reunion/transcription/srt.py +52 -0
  30. graba_reunion-0.5.0/src/graba_reunion/transcription/whisperx.py +86 -0
  31. graba_reunion-0.5.0/tests/fixtures/groq_response.json +8 -0
  32. graba_reunion-0.5.0/tests/fixtures/sample.srt +7 -0
  33. graba_reunion-0.5.0/tests/fixtures/sample_transcript.txt +1 -0
  34. graba_reunion-0.5.0/tests/test_check_deps.py +19 -0
  35. graba_reunion-0.5.0/tests/test_commands_list_show.py +36 -0
  36. graba_reunion-0.5.0/tests/test_config.py +121 -0
  37. graba_reunion-0.5.0/tests/test_db.py +79 -0
  38. graba_reunion-0.5.0/tests/test_groq_summary.py +97 -0
  39. graba_reunion-0.5.0/tests/test_paths_and_srt.py +60 -0
  40. graba_reunion-0.5.0/tests/test_setup_wizard.py +51 -0
  41. graba_reunion-0.5.0/tests/test_whisperx.py +92 -0
@@ -0,0 +1,35 @@
1
+ # Obligatorios para grabar + diarizar
2
+ HF_TOKEN=
3
+
4
+ # Opcional: solo con --groq / --enrich-only
5
+ GROQ_API_KEY=
6
+
7
+ # PulseAudio / ALSA (obligatorios para grabar)
8
+ GRABA_MIC=
9
+ GRABA_MON=
10
+ GRABA_AUDIO_BACKEND=pulse
11
+
12
+ # Salida (default: $XDG_DATA_HOME/graba-reunion/recordings)
13
+ GRABA_OUTPUT_DIR=
14
+ GRABA_SESSION_PREFIX=reunion
15
+ GRABA_DB=
16
+
17
+ # Groq (minuta y título; requiere --groq)
18
+ GRABA_GROQ_MODEL=llama-3.3-70b-versatile
19
+ GRABA_GROQ_MAX_CHARS=120000
20
+ GRABA_GROQ_TEMPERATURE=0.2
21
+
22
+ # WhisperX (transcripción + diarización)
23
+ # Defaults portables: cpu + int8. Con GPU: cuda + float16.
24
+ GRABA_WHISPERX_MODEL=large-v3
25
+ GRABA_WHISPERX_LANGUAGE=es
26
+ GRABA_WHISPERX_DEVICE=cpu
27
+ GRABA_WHISPERX_COMPUTE_TYPE=int8
28
+ GRABA_WHISPERX_BATCH_SIZE=16
29
+
30
+ # Alias opcionales (si no hay GRABA_WHISPERX_*)
31
+ # GRABA_MODEL=large-v3
32
+ # GRABA_LANGUAGE=es
33
+
34
+ # Índice PyTorch CUDA (setup --install-deps)
35
+ GRABA_TORCH_INDEX=https://download.pytorch.org/whl/cu124
@@ -0,0 +1,22 @@
1
+ reunion_*.txt
2
+ *.txt
3
+ !tests/fixtures/*.txt
4
+ __pycache__/
5
+ *.py[cod]
6
+ *.egg-info/
7
+ .eggs/
8
+ dist/
9
+ build/
10
+ *.mp3
11
+ *.srt
12
+ !tests/fixtures/*.srt
13
+ *.db
14
+ *_minuta.md
15
+ grabacion.txt
16
+ .env
17
+ .venv/
18
+ venv/
19
+ .coverage
20
+ htmlcov/
21
+ .pytest_cache/
22
+ .ruff_cache/
@@ -0,0 +1,81 @@
1
+ # AGENTS.md
2
+
3
+ Guía mínima para agentes que trabajan en este repositorio.
4
+
5
+ ## Stack
6
+
7
+ - Python 3.10+, hatchling
8
+ - CLI: argparse + subcomandos
9
+ - Audio: ffmpeg + PulseAudio (ALSA opcional)
10
+ - Transcripción: WhisperX (default) o faster-whisper (`--no-diarize`)
11
+ - Minuta (opcional, `--groq`): Groq API (`llama-3.3-70b-versatile`)
12
+ - Persistencia: SQLite (`reunions.db`)
13
+ - Config: `$XDG_CONFIG_HOME/graba-reunion/.env` (override `GRABA_CONFIG`)
14
+ - Salida default: `$XDG_DATA_HOME/graba-reunion/recordings`
15
+
16
+ ## Comandos importantes
17
+
18
+ ```bash
19
+ make setup # venv local + torch cu124
20
+ make install # pip install -e ".[dev]"
21
+ make test # pytest
22
+ make lint # ruff check
23
+ make check # lint + test
24
+ bash scripts/pipx-install.sh # instalación global con pipx
25
+ graba-reunion setup
26
+ graba-reunion check-deps
27
+ graba-reunion list
28
+ graba-reunion show 1
29
+ ```
30
+
31
+ Detalle de setup, tokens HF y variables: ver [README.md](README.md) y la [guía completa](docs/guia-completa.md).
32
+
33
+ ## Estructura
34
+
35
+ ```text
36
+ src/graba_reunion/
37
+ cli.py # router argparse
38
+ config.py # Settings + .env
39
+ paths.py # rutas sesión y DB
40
+ recording.py # ffmpeg
41
+ enrichment.py # Groq + SQLite
42
+ groq_summary.py # llamada Groq
43
+ db.py # SQLite
44
+ setup_wizard.py # wizard setup
45
+ deps_installer.py # reparar torch CUDA
46
+ commands/ # list, show, setup, check-deps, record
47
+ transcription/ # whisperx, faster_whisper, srt
48
+ scripts/ # setup.sh, pipx-install.sh
49
+ tests/ # pytest + fixtures
50
+ ```
51
+
52
+ ## Convenciones
53
+
54
+ - Código (nombres, funciones, logs técnicos): inglés
55
+ - Comentarios y docs internas: español
56
+ - Commits: Conventional Commits en inglés
57
+ - Diff mínimo; no refactors masivos sin pedido
58
+ - `show 1` / `list` rank 1 = reunión más reciente (`recorded_at DESC`)
59
+
60
+ ## Tests
61
+
62
+ - Framework: pytest en `tests/`
63
+ - Correr: `make test`
64
+ - Mockear Groq, ffmpeg, whisperx y GPU; no requerir CUDA en tests
65
+ - Fixtures en `tests/fixtures/`
66
+
67
+ ## Qué NO hacer
68
+
69
+ - No depender de `../diarizacion`
70
+ - No commitear `.env`, `.venv`, `*.mp3`, `reunion_*.txt`, `*.db`
71
+ - No añadir secretos al repo
72
+ - No instalar dependencias pesadas sin necesidad en el entorno del agente
73
+ - No añadir CI sin que lo pidan
74
+ - No borrar tests para hacer pasar la suite
75
+
76
+ ## Configuración
77
+
78
+ - Secretos y audio: `~/.config/graba-reunion/.env` (plantilla `.env.example`); fallback de lectura al `.env` del repo
79
+ - Wizard: `graba-reunion setup` (migra el `.env` del repo a XDG al escribir)
80
+ - Defaults sin GPU: `device=cpu`, `compute_type=int8`
81
+ - WhisperX viene en `dependencies`; torch CUDA: `graba-reunion setup --install-deps` o `scripts/pipx-install.sh`
@@ -0,0 +1,18 @@
1
+ .PHONY: setup install test lint format check
2
+
3
+ setup:
4
+ bash scripts/setup.sh
5
+
6
+ install:
7
+ .venv/bin/pip install -e ".[dev]"
8
+
9
+ test:
10
+ .venv/bin/pytest -q --cov=graba_reunion
11
+
12
+ lint:
13
+ .venv/bin/ruff check src tests
14
+
15
+ format:
16
+ .venv/bin/ruff format src tests
17
+
18
+ check: lint test
@@ -0,0 +1,144 @@
1
+ Metadata-Version: 2.5
2
+ Name: graba-reunion
3
+ Version: 0.5.0
4
+ Summary: Graba micrófono + monitor, transcribe con WhisperX y opcionalmente minuta con Groq
5
+ Project-URL: Homepage, https://github.com/pablogventura/graba_reunion
6
+ Project-URL: Repository, https://github.com/pablogventura/graba_reunion
7
+ Project-URL: Documentation, https://github.com/pablogventura/graba_reunion/blob/main/docs/guia-completa.md
8
+ Project-URL: Issues, https://github.com/pablogventura/graba_reunion/issues
9
+ License-Expression: MIT
10
+ Keywords: audio,diarization,ffmpeg,pulseaudio,recording,whisper
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: faster-whisper>=1.0
22
+ Requires-Dist: groq>=0.11
23
+ Requires-Dist: whisperx>=3.8
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest-cov>=5; extra == 'dev'
26
+ Requires-Dist: pytest>=8; extra == 'dev'
27
+ Requires-Dist: ruff>=0.8; extra == 'dev'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # graba-reunion
31
+
32
+ Graba reuniones (micrófono + audio del monitor), transcribe con diarización ([WhisperX](https://github.com/m-bain/whisperX)) y, si querés (`--groq`), genera título + minuta con [Groq](https://groq.com/) en SQLite.
33
+
34
+ **Documentación completa:** [docs/guia-completa.md](docs/guia-completa.md)
35
+
36
+ ## Inicio rápido
37
+
38
+ ```bash
39
+ # Instalación (desde el clone)
40
+ bash scripts/pipx-install.sh
41
+
42
+ # Tokens, mic/monitor, device CPU/GPU
43
+ graba-reunion setup
44
+ graba-reunion check-deps
45
+
46
+ # Grabar + transcribir (sin minuta)
47
+ graba-reunion
48
+ # Ctrl+C para detener y transcribir
49
+
50
+ # Con minuta Groq + SQLite
51
+ graba-reunion --groq
52
+ ```
53
+
54
+ Salida por defecto: `~/.local/share/graba-reunion/recordings/`
55
+ Config: `~/.config/graba-reunion/.env`
56
+
57
+ ## Qué hace
58
+
59
+ | Paso | Default | Opcional |
60
+ |------|---------|----------|
61
+ | Grabar mic + monitor (ffmpeg) | sí | `--skip-transcribe` solo audio |
62
+ | Transcribir con speakers (WhisperX) | sí | `--no-diarize` (faster-whisper) |
63
+ | Minuta + SQLite (Groq) | no | `--groq` / `--enrich-only` |
64
+
65
+ ## Requisitos
66
+
67
+ - Linux + PulseAudio (o PipeWire-as-Pulse); ALSA opcional
68
+ - `ffmpeg`
69
+ - Python 3.10+ (pipx trae el venv)
70
+ - [HF token](https://huggingface.co/settings/tokens) + aceptar licencias [pyannote diarization](https://huggingface.co/pyannote/speaker-diarization-community-1) y [segmentation](https://huggingface.co/pyannote/segmentation-3.0)
71
+ - Groq API key solo si usás `--groq`
72
+ - GPU NVIDIA recomendada; sin GPU: `device=cpu`
73
+
74
+ ## Comandos frecuentes
75
+
76
+ ```bash
77
+ graba-reunion # grabar + transcribir
78
+ graba-reunion -d . # grabar en el CWD
79
+ graba-reunion --groq # + minuta y DB
80
+ graba-reunion --language en --model medium --device cpu
81
+ graba-reunion --transcribe-only archivo.mp3
82
+ graba-reunion --enrich-only archivo.txt
83
+ graba-reunion list
84
+ graba-reunion show 1 # 1 = más reciente
85
+ graba-reunion show 1 --transcript
86
+ graba-reunion setup
87
+ graba-reunion setup --install-deps -y
88
+ graba-reunion check-deps
89
+ ```
90
+
91
+ ## Configuración (resumen)
92
+
93
+ | Ruta | Rol |
94
+ |------|-----|
95
+ | `~/.config/graba-reunion/.env` | Config preferida |
96
+ | `GRABA_CONFIG` | Override de ruta |
97
+ | `.env` en el clone | Fallback de lectura; se migra a XDG en el primer `setup` |
98
+ | `~/.local/share/graba-reunion/recordings/` | Grabaciones por defecto |
99
+
100
+ Plantilla de variables: [`.env.example`](.env.example).
101
+
102
+ Variables clave:
103
+
104
+ - `GRABA_MIC` / `GRABA_MON` / `GRABA_AUDIO_BACKEND`
105
+ - `HF_TOKEN`, `GROQ_API_KEY` (opcional)
106
+ - `GRABA_WHISPERX_MODEL`, `LANGUAGE`, `DEVICE` (default `cpu`), `COMPUTE_TYPE`
107
+ - `GRABA_OUTPUT_DIR`, `GRABA_SESSION_PREFIX`, `GRABA_DB`
108
+
109
+ Detalle de cada variable, flujos y troubleshooting: **[guía completa](docs/guia-completa.md)**.
110
+
111
+ ## Instalación (detalle breve)
112
+
113
+ ```bash
114
+ # pipx (uso diario)
115
+ bash scripts/pipx-install.sh
116
+
117
+ # desarrollo
118
+ make setup
119
+ make check
120
+ ```
121
+
122
+ Índice torch CUDA: `GRABA_TORCH_INDEX` (default cu124).
123
+
124
+ ## Desarrollo
125
+
126
+ Ver [AGENTS.md](AGENTS.md).
127
+
128
+ ```bash
129
+ make test
130
+ make lint
131
+ make check
132
+ ```
133
+
134
+ ## Troubleshooting rápido
135
+
136
+ | Problema | Acción |
137
+ |----------|--------|
138
+ | `whisperx` no encontrado | `graba-reunion setup --install-deps` |
139
+ | HF 401/403 | Aceptar pyannote + revisar `HF_TOKEN` |
140
+ | Sin CUDA | `device=cpu` o `setup --install-deps -y` |
141
+ | Sin audio | `pactl list sources short` (mic vs `.monitor`) |
142
+ | ¿Dónde está el `.env`? | `graba-reunion check-deps` |
143
+
144
+ Más casos: [guía completa - Troubleshooting](docs/guia-completa.md#17-troubleshooting).
@@ -0,0 +1,115 @@
1
+ # graba-reunion
2
+
3
+ Graba reuniones (micrófono + audio del monitor), transcribe con diarización ([WhisperX](https://github.com/m-bain/whisperX)) y, si querés (`--groq`), genera título + minuta con [Groq](https://groq.com/) en SQLite.
4
+
5
+ **Documentación completa:** [docs/guia-completa.md](docs/guia-completa.md)
6
+
7
+ ## Inicio rápido
8
+
9
+ ```bash
10
+ # Instalación (desde el clone)
11
+ bash scripts/pipx-install.sh
12
+
13
+ # Tokens, mic/monitor, device CPU/GPU
14
+ graba-reunion setup
15
+ graba-reunion check-deps
16
+
17
+ # Grabar + transcribir (sin minuta)
18
+ graba-reunion
19
+ # Ctrl+C para detener y transcribir
20
+
21
+ # Con minuta Groq + SQLite
22
+ graba-reunion --groq
23
+ ```
24
+
25
+ Salida por defecto: `~/.local/share/graba-reunion/recordings/`
26
+ Config: `~/.config/graba-reunion/.env`
27
+
28
+ ## Qué hace
29
+
30
+ | Paso | Default | Opcional |
31
+ |------|---------|----------|
32
+ | Grabar mic + monitor (ffmpeg) | sí | `--skip-transcribe` solo audio |
33
+ | Transcribir con speakers (WhisperX) | sí | `--no-diarize` (faster-whisper) |
34
+ | Minuta + SQLite (Groq) | no | `--groq` / `--enrich-only` |
35
+
36
+ ## Requisitos
37
+
38
+ - Linux + PulseAudio (o PipeWire-as-Pulse); ALSA opcional
39
+ - `ffmpeg`
40
+ - Python 3.10+ (pipx trae el venv)
41
+ - [HF token](https://huggingface.co/settings/tokens) + aceptar licencias [pyannote diarization](https://huggingface.co/pyannote/speaker-diarization-community-1) y [segmentation](https://huggingface.co/pyannote/segmentation-3.0)
42
+ - Groq API key solo si usás `--groq`
43
+ - GPU NVIDIA recomendada; sin GPU: `device=cpu`
44
+
45
+ ## Comandos frecuentes
46
+
47
+ ```bash
48
+ graba-reunion # grabar + transcribir
49
+ graba-reunion -d . # grabar en el CWD
50
+ graba-reunion --groq # + minuta y DB
51
+ graba-reunion --language en --model medium --device cpu
52
+ graba-reunion --transcribe-only archivo.mp3
53
+ graba-reunion --enrich-only archivo.txt
54
+ graba-reunion list
55
+ graba-reunion show 1 # 1 = más reciente
56
+ graba-reunion show 1 --transcript
57
+ graba-reunion setup
58
+ graba-reunion setup --install-deps -y
59
+ graba-reunion check-deps
60
+ ```
61
+
62
+ ## Configuración (resumen)
63
+
64
+ | Ruta | Rol |
65
+ |------|-----|
66
+ | `~/.config/graba-reunion/.env` | Config preferida |
67
+ | `GRABA_CONFIG` | Override de ruta |
68
+ | `.env` en el clone | Fallback de lectura; se migra a XDG en el primer `setup` |
69
+ | `~/.local/share/graba-reunion/recordings/` | Grabaciones por defecto |
70
+
71
+ Plantilla de variables: [`.env.example`](.env.example).
72
+
73
+ Variables clave:
74
+
75
+ - `GRABA_MIC` / `GRABA_MON` / `GRABA_AUDIO_BACKEND`
76
+ - `HF_TOKEN`, `GROQ_API_KEY` (opcional)
77
+ - `GRABA_WHISPERX_MODEL`, `LANGUAGE`, `DEVICE` (default `cpu`), `COMPUTE_TYPE`
78
+ - `GRABA_OUTPUT_DIR`, `GRABA_SESSION_PREFIX`, `GRABA_DB`
79
+
80
+ Detalle de cada variable, flujos y troubleshooting: **[guía completa](docs/guia-completa.md)**.
81
+
82
+ ## Instalación (detalle breve)
83
+
84
+ ```bash
85
+ # pipx (uso diario)
86
+ bash scripts/pipx-install.sh
87
+
88
+ # desarrollo
89
+ make setup
90
+ make check
91
+ ```
92
+
93
+ Índice torch CUDA: `GRABA_TORCH_INDEX` (default cu124).
94
+
95
+ ## Desarrollo
96
+
97
+ Ver [AGENTS.md](AGENTS.md).
98
+
99
+ ```bash
100
+ make test
101
+ make lint
102
+ make check
103
+ ```
104
+
105
+ ## Troubleshooting rápido
106
+
107
+ | Problema | Acción |
108
+ |----------|--------|
109
+ | `whisperx` no encontrado | `graba-reunion setup --install-deps` |
110
+ | HF 401/403 | Aceptar pyannote + revisar `HF_TOKEN` |
111
+ | Sin CUDA | `device=cpu` o `setup --install-deps -y` |
112
+ | Sin audio | `pactl list sources short` (mic vs `.monitor`) |
113
+ | ¿Dónde está el `.env`? | `graba-reunion check-deps` |
114
+
115
+ Más casos: [guía completa - Troubleshooting](docs/guia-completa.md#17-troubleshooting).