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.inflation().df()  # inflación anual
pe.macro.catalog().df()  # las 15 series del BCRP incluidas

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 Las 15 series incluidas: descripción, unidad, frecuencia y fechas ver
bcrp_daily · bcrp_monthly BCRP Tipo de cambio, reservas, cobre y oro (diario); inflación, tasa de referencia, PBI, desempleo y morosidad bancaria (mensual) 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.0a6

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.0a6
File Size Uploaded Provenance Actions
peruopen-0.1.0a6.tar.gz 47.0 kB With provenance Details for peruopen-0.1.0a6.tar.gz

Built distribution (wheel)

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

Total release size: 66.4 kB

Release files / peruopen-0.1.0a6.tar.gz

Download URL peruopen-0.1.0a6.tar.gz
Size 47.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4b3a2fe1e6133684035547a3b305876359baad2aac1d3f703ae57efffdc2ff21
BLAKE2b-256 checksum
How to use checksums
aea75129cba955d1e49430b614a86f0cf8c6491135e00738f48f8f299b3a4d4e
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.0a6-py3-none-any.whl

Download URL peruopen-0.1.0a6-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c8a8b1fdcf485c6ceaa8f8fd4194a550276600c107094dbe433994ba65c010c
BLAKE2b-256 checksum
How to use checksums
2a61c25cbfc8083a6ecd69662522d9b4d3416e4dfd2c7197a8c76dece404723b
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.0a6

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