mcp-bcrp 0.1.1__tar.gz → 0.1.2__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 (25) hide show
  1. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/.github/workflows/ci.yml +1 -1
  2. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/PKG-INFO +9 -10
  3. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/README.md +6 -8
  4. mcp_bcrp-0.1.2/examples/Guia_Usuario_BCRP.ipynb +207 -0
  5. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/__init__.py +1 -1
  6. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/_version.py +3 -3
  7. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/PKG-INFO +9 -10
  8. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/SOURCES.txt +1 -0
  9. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/pyproject.toml +2 -1
  10. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/.github/workflows/publish.yml +0 -0
  11. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/.gitignore +0 -0
  12. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/CONTRIBUTING.md +0 -0
  13. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/LICENSE +0 -0
  14. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/examples/basic_usage.py +0 -0
  15. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/__main__.py +0 -0
  16. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/client.py +0 -0
  17. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/search_engine.py +0 -0
  18. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/server.py +0 -0
  19. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/dependency_links.txt +0 -0
  20. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/entry_points.txt +0 -0
  21. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/requires.txt +0 -0
  22. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/top_level.txt +0 -0
  23. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/run.py +0 -0
  24. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/setup.cfg +0 -0
  25. {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/tests/test_basic.py +0 -0
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- python-version: ["3.10", "3.11", "3.12"]
14
+ python-version: ["3.9", "3.10", "3.11", "3.12"]
15
15
 
16
16
  steps:
17
17
  - uses: actions/checkout@v4
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-bcrp
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: MCP Server for Banco Central de Reserva del Perú (BCRP) Statistical API
5
5
  Author-email: Maykol Medrano <mmedrano2@uc.cl>
6
6
  License: MIT
@@ -14,13 +14,14 @@ Classifier: Intended Audience :: Financial and Insurance Industry
14
14
  Classifier: Intended Audience :: Science/Research
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
17
18
  Classifier: Programming Language :: Python :: 3.10
18
19
  Classifier: Programming Language :: Python :: 3.11
19
20
  Classifier: Programming Language :: Python :: 3.12
20
21
  Classifier: Programming Language :: Python :: 3.13
21
22
  Classifier: Topic :: Office/Business :: Financial
22
23
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
23
- Requires-Python: >=3.10
24
+ Requires-Python: >=3.9
24
25
  Description-Content-Type: text/markdown
25
26
  License-File: LICENSE
26
27
  Requires-Dist: fastmcp>=0.1.0
@@ -36,16 +37,14 @@ Dynamic: license-file
36
37
  # mcp-bcrp
37
38
 
38
39
  [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue?logo=python&logoColor=white)](https://www.python.org/downloads/)
39
- [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
40
- [![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-purple?logo=Claude&logoColor=white)](https://modelcontextprotocol.io/)
41
- [![BCRP API](https://img.shields.io/badge/API-BCRP-red)](https://estadisticas.bcrp.gob.pe/)
42
- [![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
40
+ [![GitHub](https://img.shields.io/badge/GitHub-Repository-blue?logo=github)](https://github.com/MaykolMedrano/mcp_bcrp)
41
+ [![PyPI](https://img.shields.io/pypi/v/mcp-bcrp.svg)](https://pypi.org/project/mcp-bcrp/)
42
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
43
43
 
44
- ---
45
-
46
- **MCP Server for Banco Central de Reserva del Peru (BCRP) Statistical API**
44
+ [![User Guide](https://img.shields.io/badge/Guide-User_Guide_(Spanish)-green?style=for-the-badge&logo=jupyter)](https://github.com/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
45
+ [![Colab](https://img.shields.io/badge/Open_in_Colab-blue?style=for-the-badge&logo=googlecolab)](https://colab.research.google.com/github/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
47
46
 
48
- A Model Context Protocol (MCP) server providing programmatic access to Peru's official macroeconomic statistics. This library enables AI assistants and Python applications to query over 5,000 economic indicators directly from the Central Reserve Bank of Peru.
47
+ MCP Server and Python library for the **Banco Central de Reserva del Perú (BCRP)** Statistical API. Access over 5,000 macroeconomic indicators directly from your AI agent or Python environment.
49
48
 
50
49
  ---
51
50
 
@@ -1,16 +1,14 @@
1
1
  # mcp-bcrp
2
2
 
3
3
  [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue?logo=python&logoColor=white)](https://www.python.org/downloads/)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
5
- [![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-purple?logo=Claude&logoColor=white)](https://modelcontextprotocol.io/)
6
- [![BCRP API](https://img.shields.io/badge/API-BCRP-red)](https://estadisticas.bcrp.gob.pe/)
7
- [![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
4
+ [![GitHub](https://img.shields.io/badge/GitHub-Repository-blue?logo=github)](https://github.com/MaykolMedrano/mcp_bcrp)
5
+ [![PyPI](https://img.shields.io/pypi/v/mcp-bcrp.svg)](https://pypi.org/project/mcp-bcrp/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
7
 
9
- ---
10
-
11
- **MCP Server for Banco Central de Reserva del Peru (BCRP) Statistical API**
8
+ [![User Guide](https://img.shields.io/badge/Guide-User_Guide_(Spanish)-green?style=for-the-badge&logo=jupyter)](https://github.com/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
9
+ [![Colab](https://img.shields.io/badge/Open_in_Colab-blue?style=for-the-badge&logo=googlecolab)](https://colab.research.google.com/github/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
12
10
 
13
- A Model Context Protocol (MCP) server providing programmatic access to Peru's official macroeconomic statistics. This library enables AI assistants and Python applications to query over 5,000 economic indicators directly from the Central Reserve Bank of Peru.
11
+ MCP Server and Python library for the **Banco Central de Reserva del Perú (BCRP)** Statistical API. Access over 5,000 macroeconomic indicators directly from your AI agent or Python environment.
14
12
 
15
13
  ---
16
14
 
@@ -0,0 +1,207 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "# 📊 Guía de Usuario: mcp-bcrp\n",
8
+ "\n",
9
+ "Bienvenido a la guía oficial de **mcp-bcrp**, la librería y servidor MCP para acceder a las estadísticas del **Banco Central de Reserva del Perú (BCRP)** de manera profesional y eficiente.\n",
10
+ "\n",
11
+ "[![GitHub](https://img.shields.io/badge/GitHub-Repository-blue?logo=github)](https://github.com/MaykolMedrano/mcp_bcrp)\n",
12
+ "[![PyPI](https://img.shields.io/pypi/v/mcp-bcrp.svg)](https://pypi.org/project/mcp-bcrp/)\n",
13
+ "\n",
14
+ "Esta guía te llevará desde la instalación básica hasta la generación de gráficos avanzados y análisis de datos."
15
+ ]
16
+ },
17
+ {
18
+ "cell_type": "markdown",
19
+ "metadata": {},
20
+ "source": [
21
+ "## 1. Instalación\n",
22
+ "\n",
23
+ "Primero, instalamos la librería desde PyPI. Recomendamos incluir `[charts]` para poder generar visualizaciones."
24
+ ]
25
+ },
26
+ {
27
+ "cell_type": "code",
28
+ "execution_count": null,
29
+ "metadata": {},
30
+ "outputs": [],
31
+ "source": [
32
+ "!pip install mcp-bcrp[charts] -U"
33
+ ]
34
+ },
35
+ {
36
+ "cell_type": "markdown",
37
+ "metadata": {},
38
+ "source": [
39
+ "## 2. Configuración y Metadatos\n",
40
+ "\n",
41
+ "La librería utiliza un motor de búsqueda determinista que requiere un catálogo de metadatos (~17MB). La primera vez que lo uses, se descargará automáticamente y se guardará en tu cache local."
42
+ ]
43
+ },
44
+ {
45
+ "cell_type": "code",
46
+ "execution_count": null,
47
+ "metadata": {},
48
+ "outputs": [],
49
+ "source": [
50
+ "import asyncio\n",
51
+ "from mcp_bcrp.client import AsyncBCRPClient, BCRPMetadata\n",
52
+ "import pandas as pd\n",
53
+ "\n",
54
+ "# Inicializamos el cliente de metadatos\n",
55
+ "metadata = BCRPMetadata()\n",
56
+ "\n",
57
+ "# Cargamos los metadatos (descarga automática si no existe)\n",
58
+ "await metadata.load()\n",
59
+ "\n",
60
+ "print(f\"Metadatos cargados: {len(metadata.df)} series disponibles.\")"
61
+ ]
62
+ },
63
+ {
64
+ "cell_type": "markdown",
65
+ "metadata": {},
66
+ "source": [
67
+ "## 3. Búsqueda de Indicadores\n",
68
+ "\n",
69
+ "El motor de búsqueda es **determinista**. Puede encontrar series específicas basándose en atributos como moneda, horizonte y tipo de componente."
70
+ ]
71
+ },
72
+ {
73
+ "cell_type": "code",
74
+ "execution_count": null,
75
+ "metadata": {},
76
+ "outputs": [],
77
+ "source": [
78
+ "# Ejemplo: Buscar la tasa de interés de política monetaria\n",
79
+ "query = \"tasa interes politica monetaria\"\n",
80
+ "resultado = metadata.solve(query)\n",
81
+ "\n",
82
+ "print(\"Resultado de búsqueda:\")\n",
83
+ "print(f\"Código: {resultado['codigo_serie']}\")\n",
84
+ "print(f\"Nombre: {resultado['name_original']}\")\n",
85
+ "print(f\"Confianza: {resultado['confidence']}\")"
86
+ ]
87
+ },
88
+ {
89
+ "cell_type": "markdown",
90
+ "metadata": {},
91
+ "source": [
92
+ "## 4. Obtención de Datos (Series Temporales)\n",
93
+ "\n",
94
+ "Usamos `AsyncBCRPClient` para descargar los datos. El cliente detecta automáticamente la frecuencia (diaria, mensual, trimestral, anual)."
95
+ ]
96
+ },
97
+ {
98
+ "cell_type": "code",
99
+ "execution_count": null,
100
+ "metadata": {},
101
+ "outputs": [],
102
+ "source": [
103
+ "client = AsyncBCRPClient()\n",
104
+ "\n",
105
+ "# Descargamos datos de Inflación y Tipo de Cambio\n",
106
+ "series_a_pedir = [\"PN01271PM\", \"PD04637PD\"] # IPC Variación % y T.C. Venta\n",
107
+ "\n",
108
+ "df = await client.get_series(\n",
109
+ " codes=series_a_pedir,\n",
110
+ " start_date=\"2023-01-01\",\n",
111
+ " end_date=\"2024-12-31\"\n",
112
+ ")\n",
113
+ "\n",
114
+ "print(\"Primeras filas de los datos descargados:\")\n",
115
+ "print(df.head())"
116
+ ]
117
+ },
118
+ {
119
+ "cell_type": "markdown",
120
+ "metadata": {},
121
+ "source": [
122
+ "## 5. Visualización Profesional\n",
123
+ "\n",
124
+ "La librería incluye herramientas para generar gráficos listos para reportes, manejando automáticamente el formato de fechas del BCRP."
125
+ ]
126
+ },
127
+ {
128
+ "cell_type": "code",
129
+ "execution_count": null,
130
+ "metadata": {},
131
+ "outputs": [],
132
+ "source": [
133
+ "from mcp_bcrp.server import _plot_chart # Usamos la lógica interna para el ejemplo\n",
134
+ "\n",
135
+ "# Generamos un gráfico de Expectativas de PBI\n",
136
+ "img_path = \"expectativas_pbi.png\"\n",
137
+ "\n",
138
+ "await _plot_chart(\n",
139
+ " series_codes=[\"PD38048AM\"],\n",
140
+ " period=\"2020-01/2024-12\",\n",
141
+ " title=\"Expectativas del PBI a 12 meses\",\n",
142
+ " names=[\"Expectativa PBI (%)\"],\n",
143
+ " output_path=img_path\n",
144
+ ")\n",
145
+ "\n",
146
+ "from IPython.display import Image\n",
147
+ "Image(img_path)"
148
+ ]
149
+ },
150
+ {
151
+ "cell_type": "markdown",
152
+ "metadata": {},
153
+ "source": [
154
+ "## 6. Análisis Estadístico Rápido\n",
155
+ "\n",
156
+ "Al obtener un `pandas.DataFrame`, podemos realizar análisis técnicos de inmediato."
157
+ ]
158
+ },
159
+ {
160
+ "cell_type": "code",
161
+ "execution_count": null,
162
+ "metadata": {},
163
+ "outputs": [],
164
+ "source": [
165
+ "import matplotlib.pyplot as plt\n",
166
+ "\n",
167
+ "# Correlación móvil entre Inflación y Expectativas (si tuviéramos ambos)\n",
168
+ "print(\"Resumen estadístico de las series descargadas:\")\n",
169
+ "print(df.describe())"
170
+ ]
171
+ },
172
+ {
173
+ "cell_type": "markdown",
174
+ "metadata": {},
175
+ "source": [
176
+ "---\n",
177
+ "### ¿Necesitas más ayuda?\n",
178
+ "\n",
179
+ "- **Documentación completa**: [README.md](https://github.com/MaykolMedrano/mcp_bcrp/blob/main/README.md)\n",
180
+ "- **Reportar problemas**: [GitHub Issues](https://github.com/MaykolMedrano/mcp_bcrp/issues)\n",
181
+ "\n",
182
+ "Desarrollado con ❤️ para la comunidad de analistas económicos de Perú."
183
+ ]
184
+ }
185
+ ],
186
+ "metadata": {
187
+ "kernelspec": {
188
+ "display_name": "Python 3",
189
+ "language": "python",
190
+ "name": "python3"
191
+ },
192
+ "language_info": {
193
+ "codemirror_mode": {
194
+ "name": "ipython",
195
+ "version": 3
196
+ },
197
+ "file_extension": ".py",
198
+ "mimetype": "text/x-python",
199
+ "name": "python",
200
+ "nbconvert_exporter": "python",
201
+ "pygments_lexer": "ipython3",
202
+ "version": "3.11.1"
203
+ }
204
+ },
205
+ "nbformat": 4,
206
+ "nbformat_minor": 5
207
+ }
@@ -8,7 +8,7 @@ Use as library:
8
8
  from mcp_bcrp.client import AsyncBCRPClient, BCRPMetadata
9
9
  """
10
10
 
11
- __version__ = "0.1.0"
11
+ __version__ = "0.1.2"
12
12
  __author__ = "Maykol Medrano"
13
13
 
14
14
  from mcp_bcrp.client import AsyncBCRPClient, BCRPMetadata
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.1.1'
32
- __version_tuple__ = version_tuple = (0, 1, 1)
31
+ __version__ = version = '0.1.2'
32
+ __version_tuple__ = version_tuple = (0, 1, 2)
33
33
 
34
- __commit_id__ = commit_id = 'gb1257599a'
34
+ __commit_id__ = commit_id = 'g2f2c0f637'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-bcrp
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: MCP Server for Banco Central de Reserva del Perú (BCRP) Statistical API
5
5
  Author-email: Maykol Medrano <mmedrano2@uc.cl>
6
6
  License: MIT
@@ -14,13 +14,14 @@ Classifier: Intended Audience :: Financial and Insurance Industry
14
14
  Classifier: Intended Audience :: Science/Research
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
17
18
  Classifier: Programming Language :: Python :: 3.10
18
19
  Classifier: Programming Language :: Python :: 3.11
19
20
  Classifier: Programming Language :: Python :: 3.12
20
21
  Classifier: Programming Language :: Python :: 3.13
21
22
  Classifier: Topic :: Office/Business :: Financial
22
23
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
23
- Requires-Python: >=3.10
24
+ Requires-Python: >=3.9
24
25
  Description-Content-Type: text/markdown
25
26
  License-File: LICENSE
26
27
  Requires-Dist: fastmcp>=0.1.0
@@ -36,16 +37,14 @@ Dynamic: license-file
36
37
  # mcp-bcrp
37
38
 
38
39
  [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue?logo=python&logoColor=white)](https://www.python.org/downloads/)
39
- [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
40
- [![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-purple?logo=Claude&logoColor=white)](https://modelcontextprotocol.io/)
41
- [![BCRP API](https://img.shields.io/badge/API-BCRP-red)](https://estadisticas.bcrp.gob.pe/)
42
- [![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
40
+ [![GitHub](https://img.shields.io/badge/GitHub-Repository-blue?logo=github)](https://github.com/MaykolMedrano/mcp_bcrp)
41
+ [![PyPI](https://img.shields.io/pypi/v/mcp-bcrp.svg)](https://pypi.org/project/mcp-bcrp/)
42
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
43
43
 
44
- ---
45
-
46
- **MCP Server for Banco Central de Reserva del Peru (BCRP) Statistical API**
44
+ [![User Guide](https://img.shields.io/badge/Guide-User_Guide_(Spanish)-green?style=for-the-badge&logo=jupyter)](https://github.com/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
45
+ [![Colab](https://img.shields.io/badge/Open_in_Colab-blue?style=for-the-badge&logo=googlecolab)](https://colab.research.google.com/github/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
47
46
 
48
- A Model Context Protocol (MCP) server providing programmatic access to Peru's official macroeconomic statistics. This library enables AI assistants and Python applications to query over 5,000 economic indicators directly from the Central Reserve Bank of Peru.
47
+ MCP Server and Python library for the **Banco Central de Reserva del Perú (BCRP)** Statistical API. Access over 5,000 macroeconomic indicators directly from your AI agent or Python environment.
49
48
 
50
49
  ---
51
50
 
@@ -6,6 +6,7 @@ pyproject.toml
6
6
  run.py
7
7
  .github/workflows/ci.yml
8
8
  .github/workflows/publish.yml
9
+ examples/Guia_Usuario_BCRP.ipynb
9
10
  examples/basic_usage.py
10
11
  mcp_bcrp/__init__.py
11
12
  mcp_bcrp/__main__.py
@@ -7,7 +7,7 @@ name = "mcp-bcrp"
7
7
  dynamic = ["version"]
8
8
  description = "MCP Server for Banco Central de Reserva del Perú (BCRP) Statistical API"
9
9
  readme = "README.md"
10
- requires-python = ">=3.10"
10
+ requires-python = ">=3.9"
11
11
  license = {text = "MIT"}
12
12
  authors = [
13
13
  {name = "Maykol Medrano", email = "mmedrano2@uc.cl"}
@@ -29,6 +29,7 @@ classifiers = [
29
29
  "Intended Audience :: Science/Research",
30
30
  "License :: OSI Approved :: MIT License",
31
31
  "Programming Language :: Python :: 3",
32
+ "Programming Language :: Python :: 3.9",
32
33
  "Programming Language :: Python :: 3.10",
33
34
  "Programming Language :: Python :: 3.11",
34
35
  "Programming Language :: Python :: 3.12",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes