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: pre-alpha. Ya funcionan el módulo macro (BCRP y UIT), la librería y el servidor MCP. Todavía no hay versión en PyPI ni vitrina pública. Ver docs/roadmap.md.

Qué es

peruopen reúne datasets públicos del Estado peruano (SUNAT, BCRP, INEI/RENIEC, MEF, El 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.tipo_cambio(desde="2026-01-01").df()  # pandas (o .pl() para polars)

pe.query("""
    SELECT year(fecha) AS anio, round(avg(valor), 3) AS tc_promedio
    FROM macro_series WHERE serie = '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 tres tools: list_datasets, describe_dataset 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 planificados (v0.1)

Módulo Fuente Contenido
calendario El Peruano / gob.pe Feriados y días no laborables, días hábiles 2020–2027
macro ✅ BCRP, SUNAT Tipo de cambio, inflación, tasa de referencia, PBI, UIT
geo INEI / RENIEC Ubigeos con equivalencias, coordenadas y macrorregión
sunat SUNAT Padrón reducido RUC

estado (MEF y SEACE/OECE) queda para v0.2.

Proyectos relacionados

  • perudata: microdatos de encuestas del INEI (ENAHO, ENDES…). Complementa a peruopen.
  • horaciochacon/peruopen: paquete R con el mismo nombre que envuelve el portal CKAN de datosabiertos.gob.pe. No tiene relación con este proyecto.

Licencia

El código es MIT (ver LICENSE). Los datos conservan la licencia de su fuente oficial.

Metadata

Release files for peruopen 0.1.0a2

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

Built distribution (wheel)

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

Total release size: 63.9 kB

Release files / peruopen-0.1.0a2.tar.gz

Download URL peruopen-0.1.0a2.tar.gz
Size 47.4 kB
Tags Source
SHA-256 checksum
How to use checksums
dee163c408a55badc3f64c71b47ad99d6d341766a59a257df8c6c9c3486e81ea
BLAKE2b-256 checksum
How to use checksums
c0cc418180cad1db78d475731e7397750aaf073ec83ab1df89050b83f7ee4dec
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.0a2-py3-none-any.whl

Download URL peruopen-0.1.0a2-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6da7cc9556bcccc0669b8b2edfa37678fc1ed773b552556b8c9865f680176d10
BLAKE2b-256 checksum
How to use checksums
442aaa870847cb1bb4a440c8c5f8a8c69208a5c3451ed49a7e846e4a612d83fb
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.0a2

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