garua 0.30.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.
- garua-0.30.0/.gitignore +35 -0
- garua-0.30.0/LICENSE +21 -0
- garua-0.30.0/PKG-INFO +221 -0
- garua-0.30.0/README.md +175 -0
- garua-0.30.0/pyproject.toml +109 -0
- garua-0.30.0/src/garua/__init__.py +1 -0
- garua-0.30.0/src/garua/__main__.py +9 -0
- garua-0.30.0/src/garua/data/estaciones.json +15423 -0
- garua-0.30.0/src/garua/exceptions.py +50 -0
- garua-0.30.0/src/garua/main.py +362 -0
- garua-0.30.0/src/garua/mcp_server.py +118 -0
- garua-0.30.0/src/garua/mcp_tools/__init__.py +13 -0
- garua-0.30.0/src/garua/mcp_tools/anomaly_tools.py +126 -0
- garua-0.30.0/src/garua/mcp_tools/comparison_tools.py +178 -0
- garua-0.30.0/src/garua/mcp_tools/download_tools.py +190 -0
- garua-0.30.0/src/garua/mcp_tools/file_tools.py +672 -0
- garua-0.30.0/src/garua/mcp_tools/recommendation_tools.py +125 -0
- garua-0.30.0/src/garua/mcp_tools/station_tools.py +570 -0
- garua-0.30.0/src/garua/mcp_tools/stats_tools.py +178 -0
- garua-0.30.0/src/garua/mcp_tools/summary_tools.py +165 -0
- garua-0.30.0/src/garua/models/__init__.py +113 -0
- garua-0.30.0/src/garua/models/anomaly.py +52 -0
- garua-0.30.0/src/garua/models/comparison.py +87 -0
- garua-0.30.0/src/garua/models/data_schema.py +115 -0
- garua-0.30.0/src/garua/models/file_tools.py +56 -0
- garua-0.30.0/src/garua/models/recommendation.py +80 -0
- garua-0.30.0/src/garua/models/responses.py +93 -0
- garua-0.30.0/src/garua/models/scraping.py +189 -0
- garua-0.30.0/src/garua/models/station.py +184 -0
- garua-0.30.0/src/garua/models/summary.py +55 -0
- garua-0.30.0/src/garua/schemas/anomaly.py +40 -0
- garua-0.30.0/src/garua/schemas/comparison.py +42 -0
- garua-0.30.0/src/garua/schemas/file_tools.py +102 -0
- garua-0.30.0/src/garua/schemas/mcp.py +113 -0
- garua-0.30.0/src/garua/schemas/scraping.py +106 -0
- garua-0.30.0/src/garua/schemas/station.py +26 -0
- garua-0.30.0/src/garua/schemas/summary.py +32 -0
- garua-0.30.0/src/garua/scraping/browser.py +171 -0
- garua-0.30.0/src/garua/scraping/query_modes.py +386 -0
- garua-0.30.0/src/garua/scraping/scraper.py +308 -0
- garua-0.30.0/src/garua/services/anomaly.py +674 -0
- garua-0.30.0/src/garua/services/comparison.py +545 -0
- garua-0.30.0/src/garua/services/downloaded_files.py +161 -0
- garua-0.30.0/src/garua/services/file_preview.py +252 -0
- garua-0.30.0/src/garua/services/metrics/__init__.py +336 -0
- garua-0.30.0/src/garua/services/metrics/base.py +250 -0
- garua-0.30.0/src/garua/services/recommendation.py +440 -0
- garua-0.30.0/src/garua/services/scraping.py +484 -0
- garua-0.30.0/src/garua/services/station.py +229 -0
- garua-0.30.0/src/garua/services/summary.py +344 -0
- garua-0.30.0/src/garua/settings.py +106 -0
- garua-0.30.0/src/garua/storage/csv_manager.py +141 -0
- garua-0.30.0/src/garua/utils/helpers.py +232 -0
- garua-0.30.0/src/garua/utils/html_utils.py +301 -0
- garua-0.30.0/src/garua/utils/special_values.py +38 -0
- garua-0.30.0/src/garua/utils/ui_console.py +466 -0
- garua-0.30.0/src/garua_mcp/__init__.py +1 -0
- garua-0.30.0/src/garua_mcp/__main__.py +7 -0
garua-0.30.0/.gitignore
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
venv/
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
site/
|
|
11
|
+
output/
|
|
12
|
+
*.egg-info/
|
|
13
|
+
.eggs/
|
|
14
|
+
.venv
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# PyPI publishing
|
|
18
|
+
.pypirc
|
|
19
|
+
*.whl
|
|
20
|
+
*.tar.gz
|
|
21
|
+
|
|
22
|
+
# IDEs
|
|
23
|
+
.vscode/
|
|
24
|
+
|
|
25
|
+
# Project specific
|
|
26
|
+
downloads/
|
|
27
|
+
temp/
|
|
28
|
+
test/
|
|
29
|
+
reports/
|
|
30
|
+
exports/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# Logs
|
|
34
|
+
*.log
|
|
35
|
+
logs/
|
garua-0.30.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dany Daniel Neyra
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
garua-0.30.0/PKG-INFO
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: garua
|
|
3
|
+
Version: 0.30.0
|
|
4
|
+
Summary: CLI interactiva y servidor MCP para consultar estaciones SENAMHI y descargar datos hidrometeorológicos históricos del Perú.
|
|
5
|
+
Project-URL: Homepage, https://garua.danyneyra.dev
|
|
6
|
+
Project-URL: Documentation, https://garua.danyneyra.dev
|
|
7
|
+
Project-URL: Repository, https://github.com/danyneyra/garua
|
|
8
|
+
Project-URL: Issues, https://github.com/danyneyra/garua/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/danyneyra/garua/releases
|
|
10
|
+
Project-URL: Website, https://garua.danyneyra.dev
|
|
11
|
+
Author-email: Dany Daniel <hi@danyneyra.dev>
|
|
12
|
+
Maintainer-email: Dany Daniel <hi@danyneyra.dev>
|
|
13
|
+
License-Expression: MIT
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Keywords: cli,climate,data-download,garua,garua-app,hydrology,mcp,meteorologia,model-context-protocol,peru,scraper,senamhi,weather
|
|
16
|
+
Classifier: Development Status :: 4 - Beta
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
19
|
+
Classifier: Intended Audience :: Science/Research
|
|
20
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Classifier: Programming Language :: Python :: 3
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
27
|
+
Classifier: Topic :: Scientific/Engineering :: Hydrology
|
|
28
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
29
|
+
Classifier: Topic :: Utilities
|
|
30
|
+
Requires-Python: >=3.11
|
|
31
|
+
Requires-Dist: beautifulsoup4>=4.12.3
|
|
32
|
+
Requires-Dist: fastmcp>=3.3.1
|
|
33
|
+
Requires-Dist: mcp>=1.27.1
|
|
34
|
+
Requires-Dist: pydantic>=2.13.4
|
|
35
|
+
Requires-Dist: requests>=2.34.2
|
|
36
|
+
Requires-Dist: rich>=15.0.0
|
|
37
|
+
Requires-Dist: zendriver>=0.15.3
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: black>=24.0.0; extra == 'dev'
|
|
40
|
+
Requires-Dist: isort>=5.13.0; extra == 'dev'
|
|
41
|
+
Requires-Dist: mypy>=1.13.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
43
|
+
Provides-Extra: docs
|
|
44
|
+
Requires-Dist: zensical>=0.0.45; extra == 'docs'
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
47
|
+
<div align="center">
|
|
48
|
+
<a href="https://garua.danyneyra.dev/">
|
|
49
|
+
<img alt="Logo de Garúa" src="https://garua.danyneyra.dev/images/garua-logo.svg">
|
|
50
|
+
</a>
|
|
51
|
+
|
|
52
|
+
<p><strong>Garúa</strong> descarga, explora y analiza datos hidrometeorológicos oficiales del SENAMHI Perú.</p>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
> Garúa es la llovizna fina característica de la costa peruana.
|
|
56
|
+
|
|
57
|
+
[](https://pypi.org/project/garua/)
|
|
58
|
+
[](https://www.python.org/downloads/)
|
|
59
|
+
[](https://opensource.org/licenses/MIT)
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
**Documentación:** [garua.danyneyra.dev](https://garua.danyneyra.dev)
|
|
64
|
+
|
|
65
|
+
**Código fuente:** [github.com/danyneyra/garua](https://github.com/danyneyra/garua)
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
Garúa es una herramienta de código abierto para trabajar con estaciones meteorológicas e hidrológicas del [SENAMHI]. Permite buscar estaciones, descargar datos históricos en CSV, revisar archivos locales, resumir periodos, comparar meses o años, validar calidad de datos y recomendar estaciones cercanas a un punto geográfico.
|
|
70
|
+
|
|
71
|
+
## Qué puedes hacer
|
|
72
|
+
|
|
73
|
+
| Tarea | Descripción |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| Buscar estaciones | Filtra estaciones por nombre, código, ubicación, tipo, altitud o cercanía a un punto geográfico. |
|
|
76
|
+
| Descargar históricos | Obtén datos mensuales, anuales o multianuales en archivos CSV listos para revisar o procesar. |
|
|
77
|
+
| Analizar periodos | Resume precipitación, temperatura, humedad, viento o nivel de río según el tipo de estación. |
|
|
78
|
+
| Validar calidad | Detecta duplicados, fechas faltantes, valores `S/D`, trazas `T` y otros problemas frecuentes. |
|
|
79
|
+
|
|
80
|
+
## Formas de uso
|
|
81
|
+
|
|
82
|
+
Garúa puede usarse de tres maneras:
|
|
83
|
+
|
|
84
|
+
- **App interactiva:** ejecuta `garua` y navega por un menú en terminal. Es ideal para explorar estaciones y descargar datos paso a paso.
|
|
85
|
+
- **Comandos directos:** usa parámetros cuando ya conoces la estación y el periodo, o cuando quieres automatizar búsquedas y descargas.
|
|
86
|
+
- **Servidor MCP:** conecta Garúa con VS Code, Claude Desktop, Codex u otros clientes de IA compatibles con [Model Context Protocol].
|
|
87
|
+
|
|
88
|
+
## Instalación rápida
|
|
89
|
+
|
|
90
|
+
Requisitos principales:
|
|
91
|
+
|
|
92
|
+
- Python 3.11+.
|
|
93
|
+
- Windows, macOS o Linux.
|
|
94
|
+
- Google Chrome, Brave o Microsoft Edge para las descargas desde SENAMHI.
|
|
95
|
+
|
|
96
|
+
Instala Garúa desde PyPI:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
pip install garua
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
También puedes instalarlo con `pipx` si quieres usarlo como herramienta global de terminal:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pipx install garua
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Verifica la instalación:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
garua --help
|
|
112
|
+
garua --doctor
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
La guía completa está en [Instalación](https://garua.danyneyra.dev/installation/).
|
|
116
|
+
|
|
117
|
+
## Uso rápido
|
|
118
|
+
|
|
119
|
+
Abre la app interactiva:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
garua
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
<p align="center">
|
|
126
|
+
<img src="https://garua.danyneyra.dev/images/garua-cli-ui.jpg" alt="Interfaz interactiva de Garúa en la terminal" width="820">
|
|
127
|
+
</p>
|
|
128
|
+
|
|
129
|
+
Busca estaciones desde la línea de comandos:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
garua --search Cabana
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Descarga un mes específico:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
garua --station 108047 --mode month --year 2025 --month 7
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Ejecuta el servidor MCP:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
garua-mcp
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
> Nota: cuando pidas descargar datos, Garúa abrirá un navegador local para consultar el sitio de SENAMHI y superar la verificación Cloudflare Turnstile cuando aparezca. Esto es esperado en la herramienta de descarga.
|
|
148
|
+
|
|
149
|
+
## Vista MCP
|
|
150
|
+
|
|
151
|
+
Garúa también funciona como servidor MCP. Puedes pedir tareas en lenguaje natural y el cliente usa las herramientas de Garúa para buscar estaciones, descargar datos o analizar CSV.
|
|
152
|
+
|
|
153
|
+
### Codex
|
|
154
|
+
|
|
155
|
+
<p align="center">
|
|
156
|
+
<img src="https://garua.danyneyra.dev/images/garua-codex.gif" alt="Vista de Garúa MCP en Codex" width="820">
|
|
157
|
+
</p>
|
|
158
|
+
|
|
159
|
+
### Claude Desktop
|
|
160
|
+
|
|
161
|
+
<p align="center">
|
|
162
|
+
<img src="https://garua.danyneyra.dev/images/garua-claude.gif" alt="Vista de Garúa MCP en Claude Desktop" width="820">
|
|
163
|
+
</p>
|
|
164
|
+
|
|
165
|
+
Ver configuración completa en [Configurar MCP](https://garua.danyneyra.dev/installation/#configurar-mcp) y más ejemplos en [Uso MCP](https://garua.danyneyra.dev/usage/mcp/).
|
|
166
|
+
|
|
167
|
+
Ejemplos en un cliente MCP:
|
|
168
|
+
|
|
169
|
+
```text
|
|
170
|
+
Busca estaciones meteorológicas en Arequipa sobre 3000 msnm
|
|
171
|
+
Recomienda una estación para lat -7.61, lon -77.82 con altitud 3000 msnm
|
|
172
|
+
Descarga datos de febrero 2025 de la estación Cabana
|
|
173
|
+
Resume diciembre 2025 para la estación 107008
|
|
174
|
+
Compara marzo 2025 vs marzo 2026 para Cabana
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Documentación
|
|
178
|
+
|
|
179
|
+
- [Primeros pasos](https://garua.danyneyra.dev/quickstart/)
|
|
180
|
+
- [Instalación](https://garua.danyneyra.dev/installation/)
|
|
181
|
+
- [Uso CLI](https://garua.danyneyra.dev/usage/cli/)
|
|
182
|
+
- [Uso MCP](https://garua.danyneyra.dev/usage/mcp/)
|
|
183
|
+
- [Ejemplos completos](https://garua.danyneyra.dev/usage/examples/)
|
|
184
|
+
- [Referencia de herramientas MCP](https://garua.danyneyra.dev/reference/tools/)
|
|
185
|
+
- [Variables de entorno](https://garua.danyneyra.dev/reference/environment/)
|
|
186
|
+
- [Changelog](https://garua.danyneyra.dev/changelog/)
|
|
187
|
+
|
|
188
|
+
## Guías principales
|
|
189
|
+
|
|
190
|
+
- [Buscar estaciones](https://garua.danyneyra.dev/guides/buscar-estaciones/)
|
|
191
|
+
- [Descargar datos](https://garua.danyneyra.dev/guides/descargar-datos/)
|
|
192
|
+
- [Explorar CSV](https://garua.danyneyra.dev/guides/explorar-csv/)
|
|
193
|
+
- [Resumir un periodo](https://garua.danyneyra.dev/guides/resumir-periodo/)
|
|
194
|
+
- [Comparar periodos](https://garua.danyneyra.dev/guides/comparar-periodos/)
|
|
195
|
+
- [Validar calidad de datos](https://garua.danyneyra.dev/guides/validar-datos/)
|
|
196
|
+
- [Recomendar estaciones](https://garua.danyneyra.dev/guides/recomendar-estacion/)
|
|
197
|
+
|
|
198
|
+
## Desarrollo
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
git clone https://github.com/danyneyra/garua.git
|
|
202
|
+
cd garua
|
|
203
|
+
python -m venv .venv
|
|
204
|
+
.venv\Scripts\activate
|
|
205
|
+
pip install -e ".[dev]"
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
En Linux o macOS:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
source .venv/bin/activate
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Más detalles en [Arquitectura](https://garua.danyneyra.dev/development/architecture/) y [Contribuir](https://garua.danyneyra.dev/development/contributing/).
|
|
215
|
+
|
|
216
|
+
## Licencia
|
|
217
|
+
|
|
218
|
+
Este proyecto se publica bajo los términos de la licencia MIT. Ver [LICENSE](https://github.com/danyneyra/garua/blob/main/LICENSE).
|
|
219
|
+
|
|
220
|
+
[Model Context Protocol]: https://modelcontextprotocol.io/docs/getting-started/intro
|
|
221
|
+
[SENAMHI]: https://www.senamhi.gob.pe/?p=estaciones
|
garua-0.30.0/README.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://garua.danyneyra.dev/">
|
|
3
|
+
<img alt="Logo de Garúa" src="https://garua.danyneyra.dev/images/garua-logo.svg">
|
|
4
|
+
</a>
|
|
5
|
+
|
|
6
|
+
<p><strong>Garúa</strong> descarga, explora y analiza datos hidrometeorológicos oficiales del SENAMHI Perú.</p>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
> Garúa es la llovizna fina característica de la costa peruana.
|
|
10
|
+
|
|
11
|
+
[](https://pypi.org/project/garua/)
|
|
12
|
+
[](https://www.python.org/downloads/)
|
|
13
|
+
[](https://opensource.org/licenses/MIT)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
**Documentación:** [garua.danyneyra.dev](https://garua.danyneyra.dev)
|
|
18
|
+
|
|
19
|
+
**Código fuente:** [github.com/danyneyra/garua](https://github.com/danyneyra/garua)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
Garúa es una herramienta de código abierto para trabajar con estaciones meteorológicas e hidrológicas del [SENAMHI]. Permite buscar estaciones, descargar datos históricos en CSV, revisar archivos locales, resumir periodos, comparar meses o años, validar calidad de datos y recomendar estaciones cercanas a un punto geográfico.
|
|
24
|
+
|
|
25
|
+
## Qué puedes hacer
|
|
26
|
+
|
|
27
|
+
| Tarea | Descripción |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Buscar estaciones | Filtra estaciones por nombre, código, ubicación, tipo, altitud o cercanía a un punto geográfico. |
|
|
30
|
+
| Descargar históricos | Obtén datos mensuales, anuales o multianuales en archivos CSV listos para revisar o procesar. |
|
|
31
|
+
| Analizar periodos | Resume precipitación, temperatura, humedad, viento o nivel de río según el tipo de estación. |
|
|
32
|
+
| Validar calidad | Detecta duplicados, fechas faltantes, valores `S/D`, trazas `T` y otros problemas frecuentes. |
|
|
33
|
+
|
|
34
|
+
## Formas de uso
|
|
35
|
+
|
|
36
|
+
Garúa puede usarse de tres maneras:
|
|
37
|
+
|
|
38
|
+
- **App interactiva:** ejecuta `garua` y navega por un menú en terminal. Es ideal para explorar estaciones y descargar datos paso a paso.
|
|
39
|
+
- **Comandos directos:** usa parámetros cuando ya conoces la estación y el periodo, o cuando quieres automatizar búsquedas y descargas.
|
|
40
|
+
- **Servidor MCP:** conecta Garúa con VS Code, Claude Desktop, Codex u otros clientes de IA compatibles con [Model Context Protocol].
|
|
41
|
+
|
|
42
|
+
## Instalación rápida
|
|
43
|
+
|
|
44
|
+
Requisitos principales:
|
|
45
|
+
|
|
46
|
+
- Python 3.11+.
|
|
47
|
+
- Windows, macOS o Linux.
|
|
48
|
+
- Google Chrome, Brave o Microsoft Edge para las descargas desde SENAMHI.
|
|
49
|
+
|
|
50
|
+
Instala Garúa desde PyPI:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install garua
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
También puedes instalarlo con `pipx` si quieres usarlo como herramienta global de terminal:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pipx install garua
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Verifica la instalación:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
garua --help
|
|
66
|
+
garua --doctor
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
La guía completa está en [Instalación](https://garua.danyneyra.dev/installation/).
|
|
70
|
+
|
|
71
|
+
## Uso rápido
|
|
72
|
+
|
|
73
|
+
Abre la app interactiva:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
garua
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
<p align="center">
|
|
80
|
+
<img src="https://garua.danyneyra.dev/images/garua-cli-ui.jpg" alt="Interfaz interactiva de Garúa en la terminal" width="820">
|
|
81
|
+
</p>
|
|
82
|
+
|
|
83
|
+
Busca estaciones desde la línea de comandos:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
garua --search Cabana
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Descarga un mes específico:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
garua --station 108047 --mode month --year 2025 --month 7
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Ejecuta el servidor MCP:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
garua-mcp
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
> Nota: cuando pidas descargar datos, Garúa abrirá un navegador local para consultar el sitio de SENAMHI y superar la verificación Cloudflare Turnstile cuando aparezca. Esto es esperado en la herramienta de descarga.
|
|
102
|
+
|
|
103
|
+
## Vista MCP
|
|
104
|
+
|
|
105
|
+
Garúa también funciona como servidor MCP. Puedes pedir tareas en lenguaje natural y el cliente usa las herramientas de Garúa para buscar estaciones, descargar datos o analizar CSV.
|
|
106
|
+
|
|
107
|
+
### Codex
|
|
108
|
+
|
|
109
|
+
<p align="center">
|
|
110
|
+
<img src="https://garua.danyneyra.dev/images/garua-codex.gif" alt="Vista de Garúa MCP en Codex" width="820">
|
|
111
|
+
</p>
|
|
112
|
+
|
|
113
|
+
### Claude Desktop
|
|
114
|
+
|
|
115
|
+
<p align="center">
|
|
116
|
+
<img src="https://garua.danyneyra.dev/images/garua-claude.gif" alt="Vista de Garúa MCP en Claude Desktop" width="820">
|
|
117
|
+
</p>
|
|
118
|
+
|
|
119
|
+
Ver configuración completa en [Configurar MCP](https://garua.danyneyra.dev/installation/#configurar-mcp) y más ejemplos en [Uso MCP](https://garua.danyneyra.dev/usage/mcp/).
|
|
120
|
+
|
|
121
|
+
Ejemplos en un cliente MCP:
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
Busca estaciones meteorológicas en Arequipa sobre 3000 msnm
|
|
125
|
+
Recomienda una estación para lat -7.61, lon -77.82 con altitud 3000 msnm
|
|
126
|
+
Descarga datos de febrero 2025 de la estación Cabana
|
|
127
|
+
Resume diciembre 2025 para la estación 107008
|
|
128
|
+
Compara marzo 2025 vs marzo 2026 para Cabana
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Documentación
|
|
132
|
+
|
|
133
|
+
- [Primeros pasos](https://garua.danyneyra.dev/quickstart/)
|
|
134
|
+
- [Instalación](https://garua.danyneyra.dev/installation/)
|
|
135
|
+
- [Uso CLI](https://garua.danyneyra.dev/usage/cli/)
|
|
136
|
+
- [Uso MCP](https://garua.danyneyra.dev/usage/mcp/)
|
|
137
|
+
- [Ejemplos completos](https://garua.danyneyra.dev/usage/examples/)
|
|
138
|
+
- [Referencia de herramientas MCP](https://garua.danyneyra.dev/reference/tools/)
|
|
139
|
+
- [Variables de entorno](https://garua.danyneyra.dev/reference/environment/)
|
|
140
|
+
- [Changelog](https://garua.danyneyra.dev/changelog/)
|
|
141
|
+
|
|
142
|
+
## Guías principales
|
|
143
|
+
|
|
144
|
+
- [Buscar estaciones](https://garua.danyneyra.dev/guides/buscar-estaciones/)
|
|
145
|
+
- [Descargar datos](https://garua.danyneyra.dev/guides/descargar-datos/)
|
|
146
|
+
- [Explorar CSV](https://garua.danyneyra.dev/guides/explorar-csv/)
|
|
147
|
+
- [Resumir un periodo](https://garua.danyneyra.dev/guides/resumir-periodo/)
|
|
148
|
+
- [Comparar periodos](https://garua.danyneyra.dev/guides/comparar-periodos/)
|
|
149
|
+
- [Validar calidad de datos](https://garua.danyneyra.dev/guides/validar-datos/)
|
|
150
|
+
- [Recomendar estaciones](https://garua.danyneyra.dev/guides/recomendar-estacion/)
|
|
151
|
+
|
|
152
|
+
## Desarrollo
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
git clone https://github.com/danyneyra/garua.git
|
|
156
|
+
cd garua
|
|
157
|
+
python -m venv .venv
|
|
158
|
+
.venv\Scripts\activate
|
|
159
|
+
pip install -e ".[dev]"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
En Linux o macOS:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
source .venv/bin/activate
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Más detalles en [Arquitectura](https://garua.danyneyra.dev/development/architecture/) y [Contribuir](https://garua.danyneyra.dev/development/contributing/).
|
|
169
|
+
|
|
170
|
+
## Licencia
|
|
171
|
+
|
|
172
|
+
Este proyecto se publica bajo los términos de la licencia MIT. Ver [LICENSE](https://github.com/danyneyra/garua/blob/main/LICENSE).
|
|
173
|
+
|
|
174
|
+
[Model Context Protocol]: https://modelcontextprotocol.io/docs/getting-started/intro
|
|
175
|
+
[SENAMHI]: https://www.senamhi.gob.pe/?p=estaciones
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "garua"
|
|
7
|
+
version = "0.30.0"
|
|
8
|
+
description = "CLI interactiva y servidor MCP para consultar estaciones SENAMHI y descargar datos hidrometeorológicos históricos del Perú."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "Dany Daniel", email = "hi@danyneyra.dev" }
|
|
13
|
+
]
|
|
14
|
+
maintainers = [
|
|
15
|
+
{ name = "Dany Daniel", email = "hi@danyneyra.dev" }
|
|
16
|
+
]
|
|
17
|
+
keywords = [
|
|
18
|
+
"garua",
|
|
19
|
+
"senamhi",
|
|
20
|
+
"meteorologia",
|
|
21
|
+
"peru",
|
|
22
|
+
"weather",
|
|
23
|
+
"climate",
|
|
24
|
+
"hydrology",
|
|
25
|
+
"mcp",
|
|
26
|
+
"model-context-protocol",
|
|
27
|
+
"cli",
|
|
28
|
+
"scraper",
|
|
29
|
+
"data-download",
|
|
30
|
+
"garua-app"
|
|
31
|
+
]
|
|
32
|
+
classifiers = [
|
|
33
|
+
"Development Status :: 4 - Beta",
|
|
34
|
+
"Intended Audience :: Developers",
|
|
35
|
+
"Intended Audience :: End Users/Desktop",
|
|
36
|
+
"Intended Audience :: Science/Research",
|
|
37
|
+
"License :: OSI Approved :: MIT License",
|
|
38
|
+
"Operating System :: OS Independent",
|
|
39
|
+
"Programming Language :: Python :: 3",
|
|
40
|
+
"Programming Language :: Python :: 3.11",
|
|
41
|
+
"Programming Language :: Python :: 3.12",
|
|
42
|
+
"Programming Language :: Python :: 3.13",
|
|
43
|
+
"Topic :: Scientific/Engineering :: Hydrology",
|
|
44
|
+
"Topic :: Scientific/Engineering :: Atmospheric Science",
|
|
45
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
46
|
+
"Topic :: Utilities",
|
|
47
|
+
]
|
|
48
|
+
requires-python = ">=3.11"
|
|
49
|
+
dependencies = [
|
|
50
|
+
"beautifulsoup4>=4.12.3",
|
|
51
|
+
"fastmcp>=3.3.1",
|
|
52
|
+
"mcp>=1.27.1",
|
|
53
|
+
"pydantic>=2.13.4",
|
|
54
|
+
"requests>=2.34.2",
|
|
55
|
+
"rich>=15.0.0",
|
|
56
|
+
"zendriver>=0.15.3",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[project.optional-dependencies]
|
|
60
|
+
dev = [
|
|
61
|
+
"black>=24.0.0",
|
|
62
|
+
"isort>=5.13.0",
|
|
63
|
+
"mypy>=1.13.0",
|
|
64
|
+
"pytest>=8.0.0",
|
|
65
|
+
]
|
|
66
|
+
docs = [
|
|
67
|
+
"zensical>=0.0.45",
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
[project.urls]
|
|
71
|
+
Homepage = "https://garua.danyneyra.dev"
|
|
72
|
+
Documentation = "https://garua.danyneyra.dev"
|
|
73
|
+
Repository = "https://github.com/danyneyra/garua"
|
|
74
|
+
Issues = "https://github.com/danyneyra/garua/issues"
|
|
75
|
+
Changelog = "https://github.com/danyneyra/garua/releases"
|
|
76
|
+
Website = "https://garua.danyneyra.dev"
|
|
77
|
+
|
|
78
|
+
[project.scripts]
|
|
79
|
+
garua = "garua.main:cli"
|
|
80
|
+
garua-mcp = "garua.mcp_server:main"
|
|
81
|
+
|
|
82
|
+
[tool.hatch.build.targets.wheel]
|
|
83
|
+
packages = ["src/garua", "src/garua_mcp"]
|
|
84
|
+
|
|
85
|
+
[tool.hatch.build.targets.sdist]
|
|
86
|
+
include = [
|
|
87
|
+
"/src/garua",
|
|
88
|
+
"/src/garua_mcp",
|
|
89
|
+
"/README.md",
|
|
90
|
+
"/CHANGELOG.md",
|
|
91
|
+
"/CONTRIBUTING.md",
|
|
92
|
+
"/LICENSE",
|
|
93
|
+
"/pyproject.toml",
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
[tool.black]
|
|
97
|
+
line-length = 88
|
|
98
|
+
target-version = ["py311", "py312", "py313"]
|
|
99
|
+
include = '\.pyi?$'
|
|
100
|
+
|
|
101
|
+
[tool.isort]
|
|
102
|
+
profile = "black"
|
|
103
|
+
line_length = 88
|
|
104
|
+
|
|
105
|
+
[tool.mypy]
|
|
106
|
+
python_version = "3.11"
|
|
107
|
+
warn_return_any = true
|
|
108
|
+
warn_unused_configs = true
|
|
109
|
+
disallow_untyped_defs = false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Garua: SENAMHI data tools and MCP server."""
|