This release is a pre-release and may not be stable for production use.
peruopen
Datos públicos oficiales del Perú, curados y versionados, listos para consultar con una línea de Python o SQL, y sin scraping al ejecutar.
🚧 Estado: alpha. La API puede cambiar entre versiones; los cambios se anotan en el CHANGELOG.
Qué es
peruopen reúne datasets públicos del Estado peruano en archivos Apache Parquet normalizados y validados, con un catálogo único. Se consultan con DuckDB, se exportan a Polars o Pandas, y se exponen a agentes de IA (Claude, Cursor, etc.) mediante un servidor MCP.
La diferencia con un scraper: los portales del Estado cambian, se caen o bloquean IPs. peruopen nunca consulta esos portales al ejecutarse. Un pipeline en CI genera snapshots versionados y la librería solo lee esos snapshots, que quedan cacheados en tu máquina.
Uso
pip install peruopen
📘 ¿Primera vez? Sigue la guía paso a paso: instalar, consultar los datos y conectar peruopen a Claude (MCP).
import peruopen as pe
pe.list_datasets() # qué hay
pe.macro.uit(2026) # -> 5500
pe.macro.exchange_rate(start="2026-01-01").df() # pandas (o .pl() para polars)
pe.macro.search("morosidad").df() # buscar entre todas las series del BCRP
pe.query("""
SELECT year(date) AS year, round(avg(value), 3) AS fx_avg
FROM bcrp_daily WHERE code = 'PD04638PD'
GROUP BY 1 ORDER BY 1
""").df()
La primera vez se descarga solo lo que consultas y queda en caché. Después, la librería revisa como máximo una vez al día si hay datos nuevos. No hay que hacer nada para actualizar.
| Necesito… | Cómo |
|---|---|
| Forzar la revisión de datos nuevos | pe.update() |
| Ver qué versión tengo | pe.status() |
| Trabajar sin internet | PERUOPEN_OFFLINE=1 |
| Resultados reproducibles | pe.connect(snapshot="2026-11-22") |
| Borrar la caché | pe.clear_cache() |
Para agentes de IA (MCP)
{"mcpServers": {"peruopen": {"command": "uvx", "args": ["--from", "peruopen[mcp]", "peruopen-mcp"]}}}
Expone cuatro tools: list_datasets, describe_dataset, search_series y query (SQL de solo
lectura, sin acceso a otros archivos, con límite de filas y timeout).
Desarrollo: probar en local sin la nube
pip install -e ".[pipeline,mcp]"
python -m pipelines run --target local --dir data/vitrina # cocina + vitrina local
PERUOPEN_BASE_URL="$PWD/data/vitrina" python -c "import peruopen as pe; print(pe.macro.uit())"
Datasets disponibles
| Dataset | Fuente | Contenido | Detalle |
|---|---|---|---|
bcrp_catalog |
BCRP | Catálogo de todas las series del BCRP (~17 000): nombre, unidad, frecuencia | ver |
bcrp_daily · bcrp_monthly · bcrp_quarterly · bcrp_annual |
BCRP | Datos de todas esas series: tipo de cambio, inflación, tasas, PBI, crédito, balanza comercial… | ver |
sunat_uit |
SUNAT | Valor de la UIT por año desde 1994, con su Decreto Supremo | ver |
Licencia
El código es MIT (ver LICENSE). Los datos conservan la licencia de su fuente oficial.
Metadata
Release files for peruopen 0.1.0a5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| peruopen-0.1.0a5.tar.gz | 47.0 kB | With provenance | Details for peruopen-0.1.0a5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| peruopen-0.1.0a5-py3-none-any.whl | Python 3 | none | any | Details for peruopen-0.1.0a5-py3-none-any.whl |
Total release size: 66.0 kB
Release files / peruopen-0.1.0a5.tar.gz
| Download URL | peruopen-0.1.0a5.tar.gz |
|---|---|
| Size | 47.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a04bccb552ffc22abe3107e51ed741d27121d5509b35bbf97ab8f6bb9de85c0
|
|
BLAKE2b-256 checksum How to use checksums |
780bf772155c4f79a4fccf7ef84e653de22c521e2d66ec25127857d983ccf0c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / peruopen-0.1.0a5-py3-none-any.whl
| Download URL | peruopen-0.1.0a5-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e21bda672f7184b6ccd32d48037641a0ae49bf279fc8279f40fc4394a768023
|
|
BLAKE2b-256 checksum How to use checksums |
135ea9773a6c738d4a61cdc44643d6fdc4cd6ecd683dabec7ce0c0c069622537
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for peruopen 0.1.0a5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for peruopen-0.1.0a5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.