Excel
Excel helpers from annnet.io.excel.
annnet.io.excel
Functions
load_excel_to_graph(path, graph=None, schema='auto', sheet=None, default_slice=None, default_directed=None, default_weight=1.0, **kwargs)
Load an Excel (.xlsx/.xls) file by converting it internally to CSV, then building a graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
Path to the Excel file. |
required |
graph
|
AnnNet
|
Existing graph instance. If None, a new one is created. |
None
|
schema
|
('auto', 'edge_list', 'hyperedge', 'incidence', 'adjacency', 'lil')
|
AnnNet schema to assume or infer. |
'auto'
|
sheet
|
str
|
Sheet name to load. Defaults to the first sheet. |
None
|
default_slice
|
str
|
Default slice name if not present. |
None
|
default_directed
|
bool
|
Default directedness if not present or inferrable. |
None
|
default_weight
|
float
|
Default weight if no weight column exists. |
1.0
|
**kwargs
|
Extra keyword arguments passed to the graph constructor. |
{}
|
Returns:
| Type | Description |
|---|---|
AnnNet
|
The created or augmented graph. |
Notes
- This function does not require
fastexceloropenpyxl. - The Excel is read once into memory and written to a temporary CSV, then processed with the CSV loader.
- Supported formats and schemas are identical to
load_csv_to_graph.