Excel Importer¶
pyconvexity.io.excel_importer
¶
Excel importer for PyConvexity energy system models. Imports network models from Excel workbooks with multiple sheets.
ExcelModelImporter
¶
Import network model from Excel workbook
import_model_from_excel(db_path: str, excel_path: str, network_name: Optional[str] = None, network_description: Optional[str] = None, scenario_id: Optional[int] = None, progress_callback: Optional[callable] = None) -> Dict[str, Any]
¶
Import network model from Excel workbook
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
str
|
Database path |
required |
excel_path
|
str
|
Excel file path |
required |
network_name
|
Optional[str]
|
Name for new network (if creating new) |
None
|
network_description
|
Optional[str]
|
Description for new network (if creating new) |
None
|
scenario_id
|
Optional[int]
|
Scenario ID (defaults to master scenario) |
None
|
update_existing
|
Whether to update existing components |
required | |
add_new
|
Whether to add new components |
required | |
progress_callback
|
Optional[callable]
|
Optional callback for progress updates |
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Import statistics and metadata |