https://github.com/githubjakob/read-graph-from-excel
https://github.com/githubjakob/read-graph-from-excel
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/githubjakob/read-graph-from-excel
- Owner: githubjakob
- Created: 2021-04-05T16:48:23.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-05T17:12:33.000Z (about 5 years ago)
- Last Synced: 2025-02-16T20:28:27.432Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 85.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# read-graph-from-excel
This module is a POC to read an excel spreadsheet ('xlsx') and generate a directed graph from the formulas in the spreadsheet.
The assumption is that an excel spreadsheet can be seen as one big function that maps a set of input parameters to a set of output parameters.
The idea is to visualize the dependencies between the formulas of the spreadsheed in a directed graph.
The nodes represent the cells with the formulas, e.g. node B1 has formula "B1=A1+1". The edges represent how the formulas are linked to each other, e.g. node B1 "B1=A1+1" is linked to node A1.
Nodes with no ingoing edges represent the "input parameters" of the excel spreadsheet while nodes with on outgoing edges represent the "output parameters".
## Example
The selected cell has the formula "=A1+1". The node on the very left is representing that cell - note the outgoing edge to the node "A1". You can also see that the cell "C1" is referencing the cell "B1" since the two nodes are connected.


## Curent state of the script
- Can read an excel spreadsheet
- Parse the cells on one Sheet until max_row and max_col
- Infer the dependencies between the cells
- Create and plot a graph that shows the nodes and the dependencies
## Todo
- Extend to read multiple sheets
- Extend to dynamically infer the range of the active cells in a sheet (max_row and max_col are currently hardcoded)
- Test with more sophisticated spreadsheets
- Refactor and clean up the code :-)
## Dependencies
- https://openpyxl.readthedocs.io
- https://github.com/xflr6/graphviz