Skip to main content
Pre-release

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.0a4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for peruopen 0.1.0a4
File Size Uploaded Provenance Actions
peruopen-0.1.0a4.tar.gz 46.7 kB With provenance Details for peruopen-0.1.0a4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for peruopen 0.1.0a4
File Interpreter ABI Platform Actions
peruopen-0.1.0a4-py3-none-any.whl Python 3 none any Details for peruopen-0.1.0a4-py3-none-any.whl

Total release size: 65.6 kB

Release files / peruopen-0.1.0a4.tar.gz

Download URL peruopen-0.1.0a4.tar.gz
Size 46.7 kB
Tags Source
SHA-256 checksum
How to use checksums
749fcb7abf6c24b587003559b9d7d1f6b087c65958f1f4751693d6d3e7756195
BLAKE2b-256 checksum
How to use checksums
6eb9c1982a3e15cc511a4d9fc326a02ca82972ee15a9cf449ad513cf633ff240
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 log

Release files / peruopen-0.1.0a4-py3-none-any.whl

Download URL peruopen-0.1.0a4-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecbd8a7e6a6230c8c69a6956be7fca32dffde9bb7601a3f87d1a410171bcfb43
BLAKE2b-256 checksum
How to use checksums
44c60b0e43d6c6efb2d7ed96deaf65a3826289eb6a2afc7f198e2d4304343216
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 log

Security for peruopen 0.1.0a4

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.

Select from 2 files

Attestation for peruopen-0.1.0a4.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page