Skip to content

Commit 74ac8ad

Browse files
authored
Merge pull request #11 from dalager/9-missing-scipy-module-in-larger-sheets
Missing scipy module
2 parents 6bc02e6 + ba5449c commit 74ac8ad

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,5 @@ cython_debug/
162162
#.idea/
163163
venv/Lib/site-packages
164164
venv
165+
*.xlsx
166+
*.xlsx.png

README.md

+7-13
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Tool to analyze and visualize dependencies between cells in Excel spreadsheets i
88

99
Will generate a graph of the dependencies between cells in an Excel spreadsheet. Data extracted with `openpyxl` (<https://foss.heptapod.net/openpyxl/openpyxl>), the graph is generated with the `networkx` library (<https://networkx.org/>) and is visualized using `matplotlib`.
1010

11-
This is a simple tool and maybe even naïve in its approach - it was hacked together in two evenings and would benefit from some refactoring and more features. It is meant as a starting point for further development.
1211
<br clear="right"/>
1312

1413
## Definitions
@@ -39,10 +38,6 @@ graph TD
3938
4039
```
4140

42-
The way the graph is built is by iterating over all cells in the spreadsheet and extracting the references in the formula of each cell. The references are then added as edges in the graph.
43-
44-
A cell within a range is considered a dependency of the range itself, but not of the other cells in the range.
45-
4641
## Installation from pypi package
4742

4843
PyPi project: [graphedexcel](https://pypi.org/project/graphedexcel/)
@@ -66,13 +61,11 @@ pip install -e .
6661
python -m graphedexcel <path_to_excel_file> [--verbose] [--no-visualize] [--keep-direction] [--open-image]
6762
```
6863

69-
Depending on the size of the spreadsheet you might want to adjust the plot configuration in the code to to make the graph more readable (remove labels, decrease widths and sizes etc)
70-
71-
In [graph_visualizer.py](src/graph_visualizer.py) you will find three configuration for small, medium and large graphs. You can adjust the configuration to your needs.
64+
Depending on the size of the spreadsheet you might want to adjust the plot configuration in the code to to make the graph more readable (remove labels, decrease widths and sizes etc) - you can find the configuration in [graph_visualizer.py](src/graphedexcel/graph_visualizer.py) with settings for small, medium and large graphs. You can adjust the configuration to your needs - but this only working if you run from source.
7265

7366
### Arguments
7467

75-
`--verbose` will dump formula cell contents during (more quiet)
68+
`--verbose` will dump formula cell contents during (more noisy)
7669

7770
`--no-visualize` will skip the visualization step and only print the summary (faster)
7871

@@ -82,7 +75,7 @@ In [graph_visualizer.py](src/graph_visualizer.py) you will find three configurat
8275

8376
## Sample output
8477

85-
The following is the output of running the script on the provided `docs/Book1.xlsx` file.
78+
The following is the output of running the script on the sample `docs/Book1.xlsx` file.
8679

8780
```bash
8881
=== Dependency Graph Summary ===
@@ -114,14 +107,16 @@ Graph visualization saved to images/.\Book1.xlsx.png
114107

115108
## Sample plot
116109

117-
More in `/images` folder.
110+
More in `docs/images` folder.
118111

119112
![Sample graph](docs/images/simplified_1.xlsx5.png)
120113

121114
## Tests
122115

116+
Just run pytest in the root folder.
117+
123118
```bash
124-
pytest test_cell_reference_extraction.py
119+
pytest
125120
```
126121

127122
## Contribute
@@ -136,4 +131,3 @@ You can help with the following, that I have thought of so far:
136131
- Improve the visualization and the ease of configuration
137132
- Add more examples
138133
- Add more documentation
139-
- Package the script for easier installation and use with PyPi

pyproject.toml

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ classifiers = [
1111
"Operating System :: OS Independent",
1212
]
1313

14-
dependencies = ["networkx>=3.3", "openpyxl>=3.1", "matplotlib>=3.9"]
14+
dependencies = [
15+
"networkx>=3.3",
16+
"openpyxl>=3.1",
17+
"matplotlib>=3.9",
18+
"scipy>=1.14",
19+
]
1520

1621
[project.optional-dependencies]
1722
test = ["black==21.9b0", "pytest==8.3"]

0 commit comments

Comments
 (0)