# searph-s0708023/taap_surakshak architecture

> Architecture diagram of the GitHub repository searph-s0708023/taap_surakshak, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/searph-s0708023/taap_surakshak
- Repository: https://github.com/searph-s0708023/taap_surakshak

## Overview

This repository is a SQLite-backed Mumbai heat and health data pipeline. Its principal workflow fetches daily weather, stores and derives climate measures, exposes joined daily features, then exports ML-ready datasets. The tree also includes population and vulnerability data files, but no sampled code shows them being loaded. The README is empty, and `calculate_thermal.py` is empty, so those capabilities and their wiring are not inferred.

Main entry points: [`mumbai_heat_health.db`](https://github.com/searph-s0708023/taap_surakshak/blob/main/mumbai_heat_health.db) (SQLite database), [`process_data.py`](https://github.com/searph-s0708023/taap_surakshak/blob/main/process_data.py) (Fill and clean data), [`create_view.py`](https://github.com/searph-s0708023/taap_surakshak/blob/main/create_view.py) (Daily ML feature view), [`create_database.py`](https://github.com/searph-s0708023/taap_surakshak/blob/main/create_database.py) (Create database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data Setup"]
  node_db[("SQLite database")]
  node_schema["Database schema<br/>[schema.sql]"]
  node_create_db["Create database<br/>[create_database.py]"]
  node_fetch["Fetch weather<br/>[fetch_weather.py]"]
  node_dates["Populate dates<br/>[populate_dates.py]"]
  node_locations["Populate locations"]
end

subgraph group_climate["Climate Processing"]
  node_heat_index["Heat index"]
  node_anomaly["Temperature anomaly"]
  node_lags["Weather lags<br/>[calculate_lags.py]"]
  node_thermal["Thermal metrics"]
  node_aggregate["Climate aggregates<br/>[aggregate.py]"]
end

subgraph group_features["Feature Assembly"]
  node_view_builder["Build feature view<br/>[create_view.py]"]
  node_feature_view["Daily ML feature view<br/>[create_view.py]"]
end

subgraph group_outputs["Data Outputs"]
  node_export_ready["Export ML-ready data<br/>[export.py]"]
  node_ready_csv["ML-ready CSV"]
  node_process["Fill and clean data<br/>[process_data.py]"]
  node_filled_csv["Filled dataset"]
  node_clean_csv["Strict cleaned dataset"]
end

node_weather_service(("NASA POWER"))

node_create_db -->|"reads schema"| node_schema
node_create_db -->|"creates schema"| node_db
node_weather_service -->|"returns weather"| node_fetch
node_fetch -->|"writes observations"| node_db
node_dates -->|"populates dates"| node_db
node_locations -->|"populates wards"| node_db
node_heat_index -->|"updates heat index"| node_db
node_anomaly -->|"updates anomalies"| node_db
node_lags -->|"updates lag values"| node_db
node_thermal --> node_db
node_aggregate -->|"refreshes aggregates"| node_db
node_view_builder -->|"creates view"| node_db
node_view_builder -->|"defines"| node_feature_view
node_export_ready -->|"queries"| node_feature_view
node_export_ready -->|"writes CSV"| node_ready_csv
node_process -->|"queries"| node_feature_view
node_process -->|"writes CSV"| node_filled_csv
node_process -->|"writes CSV"| node_clean_csv

click node_db "https://github.com/searph-s0708023/taap_surakshak/blob/main/mumbai_heat_health.db"
click node_schema "https://github.com/searph-s0708023/taap_surakshak/blob/main/schema.sql"
click node_create_db "https://github.com/searph-s0708023/taap_surakshak/blob/main/create_database.py"
click node_fetch "https://github.com/searph-s0708023/taap_surakshak/blob/main/fetch_weather.py"
click node_dates "https://github.com/searph-s0708023/taap_surakshak/blob/main/populate_dates.py"
click node_locations "https://github.com/searph-s0708023/taap_surakshak/blob/main/populate_locations.py"
click node_heat_index "https://github.com/searph-s0708023/taap_surakshak/blob/main/calculate_heat_index.py"
click node_anomaly "https://github.com/searph-s0708023/taap_surakshak/blob/main/calculate_anomaly.py"
click node_lags "https://github.com/searph-s0708023/taap_surakshak/blob/main/calculate_lags.py"
click node_thermal "https://github.com/searph-s0708023/taap_surakshak/blob/main/calculate_thermal.py"
click node_aggregate "https://github.com/searph-s0708023/taap_surakshak/blob/main/aggregate.py"
click node_view_builder "https://github.com/searph-s0708023/taap_surakshak/blob/main/create_view.py"
click node_feature_view "https://github.com/searph-s0708023/taap_surakshak/blob/main/create_view.py"
click node_export_ready "https://github.com/searph-s0708023/taap_surakshak/blob/main/export.py"
click node_ready_csv "https://github.com/searph-s0708023/taap_surakshak/blob/main/mumbai_ml_ready.csv"
click node_process "https://github.com/searph-s0708023/taap_surakshak/blob/main/process_data.py"
click node_filled_csv "https://github.com/searph-s0708023/taap_surakshak/blob/main/mumbai_ml_filled.csv"
click node_clean_csv "https://github.com/searph-s0708023/taap_surakshak/blob/main/mumbai_ml_cleaned_no_empty_cols.csv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_db,node_schema,node_create_db,node_fetch,node_dates,node_locations toneBlue
class node_heat_index,node_anomaly,node_lags,node_thermal,node_aggregate toneAmber
class node_view_builder,node_feature_view toneMint
class node_export_ready,node_ready_csv,node_process,node_filled_csv,node_clean_csv toneRose
class node_weather_service toneIndigo
```

## Components

### Data Setup

- [SQLite database](https://github.com/searph-s0708023/taap_surakshak/blob/main/mumbai_heat_health.db): `mumbai_heat_health.db`
- [Database schema](https://github.com/searph-s0708023/taap_surakshak/blob/main/schema.sql): `schema.sql`
- [Create database](https://github.com/searph-s0708023/taap_surakshak/blob/main/create_database.py): `create_database.py`
- [Fetch weather](https://github.com/searph-s0708023/taap_surakshak/blob/main/fetch_weather.py): `fetch_weather.py`
- [Populate dates](https://github.com/searph-s0708023/taap_surakshak/blob/main/populate_dates.py): `populate_dates.py`
- [Populate locations](https://github.com/searph-s0708023/taap_surakshak/blob/main/populate_locations.py): `populate_locations.py`

### Climate Processing

- [Heat index](https://github.com/searph-s0708023/taap_surakshak/blob/main/calculate_heat_index.py): `calculate_heat_index.py`
- [Temperature anomaly](https://github.com/searph-s0708023/taap_surakshak/blob/main/calculate_anomaly.py): `calculate_anomaly.py`
- [Weather lags](https://github.com/searph-s0708023/taap_surakshak/blob/main/calculate_lags.py): `calculate_lags.py`
- [Thermal metrics](https://github.com/searph-s0708023/taap_surakshak/blob/main/calculate_thermal.py): `calculate_thermal.py`
- [Climate aggregates](https://github.com/searph-s0708023/taap_surakshak/blob/main/aggregate.py): `aggregate.py`

### Feature Assembly

- [Build feature view](https://github.com/searph-s0708023/taap_surakshak/blob/main/create_view.py): `create_view.py`
- [Daily ML feature view](https://github.com/searph-s0708023/taap_surakshak/blob/main/create_view.py): `create_view.py`

### Data Outputs

- [Export ML-ready data](https://github.com/searph-s0708023/taap_surakshak/blob/main/export.py): `export.py`
- [ML-ready CSV](https://github.com/searph-s0708023/taap_surakshak/blob/main/mumbai_ml_ready.csv): `mumbai_ml_ready.csv`
- [Fill and clean data](https://github.com/searph-s0708023/taap_surakshak/blob/main/process_data.py): `process_data.py`
- [Filled dataset](https://github.com/searph-s0708023/taap_surakshak/blob/main/mumbai_ml_filled.csv): `mumbai_ml_filled.csv`
- [Strict cleaned dataset](https://github.com/searph-s0708023/taap_surakshak/blob/main/mumbai_ml_cleaned_no_empty_cols.csv): `mumbai_ml_cleaned_no_empty_cols.csv`

### Other components

- **NASA POWER**

## Connections

- Create database → Database schema: reads schema
- Create database → SQLite database: creates schema
- NASA POWER → Fetch weather: returns weather
- Fetch weather → SQLite database: writes observations
- Populate dates → SQLite database: populates dates
- Populate locations → SQLite database: populates wards
- Heat index → SQLite database: updates heat index
- Temperature anomaly → SQLite database: updates anomalies
- Weather lags → SQLite database: updates lag values
- Thermal metrics → SQLite database
- Climate aggregates → SQLite database: refreshes aggregates
- Build feature view → SQLite database: creates view
- Build feature view → Daily ML feature view: defines
- Export ML-ready data → Daily ML feature view: queries
- Export ML-ready data → ML-ready CSV: writes CSV
- Fill and clean data → Daily ML feature view: queries
- Fill and clean data → Filled dataset: writes CSV
- Fill and clean data → Strict cleaned dataset: writes CSV
