

# data_retriever

`retrieval.data_retriever`

Example script for processing EC data using nova_fde.

This script demonstrates how to use the nova_fde package to process Energy Community (EC) data with proper database authentication, error handling, and performance analysis.

## Functions

| Name | Description |
|----|----|
| [main](#nova_ec.retrieval.data_retriever.main) | Execute the EC data processing workflow. |
| [process_ec_data](#nova_ec.retrieval.data_retriever.process_ec_data) | Process Energy Community data with project-specific logic. |

### main

``` python
retrieval.data_retriever.main()
```

Execute the EC data processing workflow.

This function parses command line arguments, initializes the data engine, processes the data, and outputs the results. It includes comprehensive error handling and logging.

Command line arguments: –project-root: Path to project root directory –check-credentials: Check credential availability before processing –force-refresh: Force refresh cached data –check-password-expiry: Check if database password is nearing expiration

### process_ec_data

``` python
retrieval.data_retriever.process_ec_data(data_frames, processor)
```

Process Energy Community data with project-specific logic.

This function takes data frames retrieved from SQL queries and processes them to create a unified dataset of EC systems.

#### Parameters

| Name | Type | Description | Default |
|----|----|----|----|
| data_frames | dict\[str, pd.DataFrame\] | Dictionary containing the data frames retrieved from SQL queries. Expected keys: “systems”, “snh”, “block”. | *required* |
| processor | DataProcessor | Data processor object providing utility methods for data processing. | *required* |

#### Returns

| Name | Type | Description |
|----|----|----|
|  | pd.DataFrame | Processed and merged dataset containing EC system information. |

#### Notes

The processing steps include: - Deduplicating columns - Filtering for active systems - Merging data from multiple sources - Converting date columns to datetime format
