# tonmoypaul2003/nasapowerprocessor architecture

> Architecture diagram of the GitHub repository tonmoypaul2003/nasapowerprocessor, 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/tonmoypaul2003/nasapowerprocessor
- Repository: https://github.com/tonmoypaul2003/nasapowerprocessor

## Overview

NASA Power Data Processor is a Python library for downloading daily climate data for multiple regions and turning the responses into enriched, merged CSVs. The principal workflow starts with a district database, requests data from NASA POWER, cleans the downloaded files, adds region and coordinate metadata, and merges the results. Parameter loading, editing, and saving customize requests; logging records processor activity. The README documents these stages, and the sampled implementation is in one module.

Main entry points: [`NASADataProcessor.py`](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py) (Processor), [`district_database.csv`](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/district_database.csv) (District database), [`custom_params.json`](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/custom_params.json) (Parameter JSON)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and configuration"]
  node_districts["District database"]
  node_parameters["Parameter manager"]
  node_params_json["Parameter JSON<br/>[custom_params.json]"]
end

subgraph group_processing["Data processing"]
  node_processor["Processor"]
  node_downloader["Batch downloader"]
  node_cleaner["CSV cleaner"]
  node_enricher["Location enricher"]
  node_merger["CSV merger"]
  node_logger["Activity logger"]
end

subgraph group_integrations["External services and outputs"]
  node_nasa{{"NASA POWER API"}}
  node_regional_csvs["Regional CSV files"]
  node_merged_csv["Merged CSV"]
  node_log_file["Log file"]
end

node_user(("Library user"))

node_user -->|"uses"| node_processor
node_processor -->|"reads"| node_districts
node_processor -->|"configures"| node_parameters
node_parameters -.->|"loads"| node_params_json
node_parameters -.->|"saves"| node_params_json
node_processor -->|"runs"| node_downloader
node_downloader -->|"reads"| node_districts
node_downloader -->|"uses"| node_parameters
node_downloader -->|"requests data"| node_nasa
node_downloader -->|"writes"| node_regional_csvs
node_processor -->|"runs"| node_cleaner
node_cleaner -->|"cleans"| node_regional_csvs
node_processor -->|"runs"| node_enricher
node_enricher -->|"reads"| node_districts
node_enricher -->|"adds metadata"| node_regional_csvs
node_processor -->|"runs"| node_merger
node_merger -->|"reads"| node_regional_csvs
node_merger -->|"writes"| node_merged_csv
node_processor -->|"records activity"| node_logger
node_logger -->|"writes"| node_log_file

click node_processor "https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py"
click node_districts "https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/district_database.csv"
click node_parameters "https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py"
click node_params_json "https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/custom_params.json"
click node_downloader "https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py"
click node_cleaner "https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py"
click node_enricher "https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py"
click node_merger "https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py"
click node_logger "https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py"

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_districts,node_parameters,node_params_json,node_user toneBlue
class node_processor,node_downloader,node_cleaner,node_enricher,node_merger,node_logger toneAmber
class node_nasa,node_regional_csvs,node_merged_csv,node_log_file toneMint
```

## Components

### Inputs and configuration

- [District database](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/district_database.csv): `district_database.csv`
- [Parameter manager](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py): `NASADataProcessor.py`
- [Parameter JSON](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/custom_params.json): `custom_params.json`

### Data processing

- [Processor](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py): `NASADataProcessor.py`
- [Batch downloader](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py): `NASADataProcessor.py`
- [CSV cleaner](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py): `NASADataProcessor.py`
- [Location enricher](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py): `NASADataProcessor.py`
- [CSV merger](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py): `NASADataProcessor.py`
- [Activity logger](https://github.com/tonmoypaul2003/nasapowerprocessor/blob/main/NASADataProcessor.py): `NASADataProcessor.py`

### External services and outputs

- **NASA POWER API**
- **Regional CSV files**
- **Merged CSV**
- **Log file**

### Other components

- **Library user**

## Connections

- Library user → Processor: uses
- Processor → District database: reads
- Processor → Parameter manager: configures
- Parameter manager → Parameter JSON: loads
- Parameter manager → Parameter JSON: saves
- Processor → Batch downloader: runs
- Batch downloader → District database: reads
- Batch downloader → Parameter manager: uses
- Batch downloader → NASA POWER API: requests data
- Batch downloader → Regional CSV files: writes
- Processor → CSV cleaner: runs
- CSV cleaner → Regional CSV files: cleans
- Processor → Location enricher: runs
- Location enricher → District database: reads
- Location enricher → Regional CSV files: adds metadata
- Processor → CSV merger: runs
- CSV merger → Regional CSV files: reads
- CSV merger → Merged CSV: writes
- Processor → Activity logger: records activity
- Activity logger → Log file: writes
