Vistas Streamlit

Public landing page view for SIGAM.

views.landing._img_b64(path, mime='image/png')

Encode an image file as a data URI.

Parámetros:
  • path (Path) – Image file path.

  • mime (str) – MIME type to include in the data URI.

Devuelve:

Base64 data URI for embedding in HTML.

Tipo del valor devuelto:

str

views.landing.show()

Render the public landing page.

The page displays the SIGAM introduction, project information, quick statistics, and navigation actions that update Streamlit session state for login routing.

Login view for municipality and administrator demo access.

views.login.show()

Municipal portal home view.

views.muni_home.show()

Render the municipal home page.

The page reads the active municipality from Streamlit session state, shows submission status, score KPIs, history, service charts, and navigation to the IGSM form.

Municipal IGSM form view.

views.muni_form.show()

Render the municipal IGSM form workflow.

The page loads municipality context and previous responses from Streamlit session state, renders one applicable service at a time, updates in-memory form responses, and routes to the summary screen before submission.

views.muni_form._render_indicador(ind, serv_nombre)

Render one indicator input according to its configured type.

Parámetros:
  • ind (dict) – Indicator metadata dictionary.

  • serv_nombre (str) – Service name that owns the indicator.

views.muni_form._mostrar_resumen(nombre, diversificados)

Render the review and confirmation screen before submission.

Parámetros:
  • nombre (str) – Municipality display name.

  • diversificados (list) – Diversified service keys applicable to the municipality.

Municipal results view.

views.muni_results.show()

Render the municipal IGSM results page.

The page reads the active municipality from Streamlit session state, shows summary KPIs, service detail, historical analysis, anomaly alerts, and CSV download controls.

National dashboard view for the Contraloria portal.

views.admin_dashboard.show()

Render the national IGSM dashboard.

The page loads ranking and national statistics, renders KPI cards, charts, filters, a complete ranking table, and a CSV download button in Streamlit.

views.admin_dashboard._nivel(score)

Classify a score into a maturity level.

Parámetros:

score (float) – IGSM score in the 0-1 range.

Devuelve:

Maturity level label.

Tipo del valor devuelto:

str

Municipality detail and comparison view for administrators.

views.admin_municipalities.show()

Render the administrator municipality-detail page.

The page lets the user select one or two municipalities, then renders KPI cards, comparative charts, service summaries, and a CSV export in Streamlit.

Advanced analytics view for the Contraloria portal.

views.admin_analysis.show()

Render the advanced analytics page.

The page reads national ranking data, creates geospatial, cluster, correlation, historical trend, and SEM analyses, and writes the resulting controls and charts to the active Streamlit page.

Stage-weight management view for the Contraloria portal.

views.admin_weights.show()

Render the IGSM weight management page.

The page loads effective weights into Streamlit session state, provides controls for saving new stage weights, simulates ranking impact, and renders the local version history.

Export and publication view for the Contraloria portal.

views.admin_export._nombre_corto(nombre)

Return the short display name for a service.

Parámetros:

nombre (str) – Full service name.

Devuelve:

Short service name when configured, otherwise the original name.

Tipo del valor devuelto:

str

views.admin_export._generar_excel_nacional(ranking, stats)

Generate the national IGSM Excel report.

Parámetros:
  • ranking (list) – National ranking records.

  • stats (dict) – National summary statistics.

Devuelve:

Excel workbook bytes.

Tipo del valor devuelto:

bytes

views.admin_export._generar_excel_municipalidad(nombre)

Generate an individual municipality Excel report.

Parámetros:

nombre (str) – Municipality display name.

Devuelve:

Excel workbook bytes, or None when the municipality is unknown.

Tipo del valor devuelto:

bytes | None

views.admin_export.show()

Render the export and publication page.

The page offers national and municipal downloads, preview tables, filtered CSV exports, and ranking publication controls backed by Streamlit session state.