Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/davi-huanuco/python-matriz-correlacion/llms.txt

Use this file to discover all available pages before exploring further.

All application data is persisted locally in a single file called datos.json. The application reads this file on startup, normalizes its contents, and writes back to it on every change. There is no database or remote storage — datos.json is the single source of truth.

JSON schema

The top-level object has four keys.
meses
string[]
required
Ordered list of month names (e.g. "Enero", "Febrero"). All indicators share this same list of months. Adding or removing a month via the UI triggers sincronizar_meses_en_indicadores to keep indicator value maps in sync.
indicadores
object
required
Map of indicator code strings to indicator objects. Each key is a short code such as "IND001".
simulaciones
object[]
required
List of PDCA simulation records associated with indicators.
benchmarks
object[]
required
List of benchmark records that compare indicator averages against reference values.

Real data example

The following is the actual contents of datos.json from the repository:
{
  "meses": [
    "Enero",
    "Febrero",
    "Marzo",
    "Abril",
    "Mayo",
    "junio"
  ],
  "indicadores": {
    "IND003": {
      "nombre": "Porcentaje de incidentes de interoperabilidad resueltos dentro del tiempo establecido",
      "valores": {
        "Enero": 70.0,
        "Febrero": 55.0,
        "Marzo": 68.0,
        "Abril": 70.0,
        "Mayo": 78.0,
        "junio": 100.0
      }
    },
    "IND001": {
      "nombre": "Porcentaje de servicios interoperables validados mediante pruebas",
      "valores": {
        "Enero": 85.0,
        "Febrero": 45.0,
        "Marzo": 50.0,
        "Abril": 65.0,
        "Mayo": 80.0,
        "junio": 60.0
      }
    },
    "IND002": {
      "nombre": "Porcentaje de disponibilidad de los servicios de interoperabilidad",
      "valores": {
        "Enero": 90.0,
        "Febrero": 85.0,
        "Marzo": 60.0,
        "Abril": 70.0,
        "Mayo": 82.0,
        "junio": 85.0
      }
    }
  },
  "simulaciones": [
    {
      "id": 1,
      "indicador_codigo": "IND003",
      "oportunidad": "La disponibilidad del servicio presenta variaciones entre meses y puede mejorar con monitoreo preventivo.",
      "plan": "Implementar alertas tempranas y revisar semanalmente los servicios con menor disponibilidad.",
      "do": "Se configuraron alertas para caidas del servicio y se asigno un responsable de seguimiento semanal.",
      "check": "Se compararan los valores de disponibilidad antes y despues de aplicar las alertas preventivas.",
      "act": "Si la disponibilidad mejora, se estandarizara el monitoreo preventivo para todos los servicios.",
      "estado": "En proceso"
    }
  ],
  "benchmarks": [
    {
      "id": 1,
      "indicador_codigo": "IND003",
      "valor_referencia": 90.0,
      "fuente": "institucinal",
      "descripcion": "datos",
      "criterio": "Mayor es mejor"
    }
  ]
}

Functions

cargar_datos

def cargar_datos() -> dict
Loads datos.json from disk and returns a fully normalized data dictionary. If the file does not exist, returns an empty structure with all four top-level keys initialized to their zero values. After loading, calls normalizar_indicadores, normalizar_simulaciones, and normalizar_benchmarks to ensure every record has the expected shape.

guardar_datos

def guardar_datos(datos: dict) -> None
Serializes the data dictionary to datos.json using UTF-8 encoding with a 2-space indent. Overwrites the file on every call.
datos
dict
required
The full application data dictionary to persist.

sincronizar_meses_en_indicadores

def sincronizar_meses_en_indicadores(datos: dict) -> None
Keeps every indicator’s valores map in sync with the global meses list. For each indicator it adds any month in meses that is missing from valores (defaulting to null), and removes any month in valores that is no longer in meses. Modifies datos in place.
datos
dict
required
The full application data dictionary. Modified in place.

normalizar_numero

def normalizar_numero(valor: str) -> float
Converts a string number to a float, accepting either a comma or a period as the decimal separator. Raises ValueError if valor cannot be parsed after replacement.
valor
str
required
Numeric string, optionally using "," as the decimal separator (e.g. "3,14" or "3.14").

normalizar_indicadores

def normalizar_indicadores(indicadores: dict) -> dict
Accepts a raw indicator map loaded from disk and returns a clean copy where every entry has the canonical shape {"nombre": str, "valores": dict}. Entries that already have nombre and valores keys are passed through with whitespace stripped. Entries in legacy formats (where the key is the name rather than a code) are converted and assigned an auto-generated code such as IND001.
indicadores
dict
required
Raw indicator map from datos.json. May be in legacy or canonical format.

normalizar_simulaciones

def normalizar_simulaciones(simulaciones: list) -> list
Accepts a raw list of simulation records and returns a new list where every entry is a dict with all expected PDCA keys present. Missing keys default to empty strings or "Pendiente" for estado. Non-dict entries are skipped.
simulaciones
list
required
Raw list of simulation records from datos.json.

normalizar_benchmarks

def normalizar_benchmarks(benchmarks: list) -> list
Accepts a raw list of benchmark records and returns a new list where every entry has all expected keys. Missing valor_referencia defaults to null; missing criterio defaults to "Mayor es mejor". Non-dict entries are skipped.
benchmarks
list
required
Raw list of benchmark records from datos.json.

siguiente_id_benchmark

def siguiente_id_benchmark(datos: dict) -> int
Returns the next available integer ID for a new benchmark record by finding the maximum existing id across all benchmarks and adding 1. Returns 1 when there are no existing benchmarks.
datos
dict
required
The full application data dictionary.

Build docs developers (and LLMs) love