xlsx-viewer-pro 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xlsx_viewer_pro-1.0.0/LICENSE +21 -0
- xlsx_viewer_pro-1.0.0/MANIFEST.in +6 -0
- xlsx_viewer_pro-1.0.0/PKG-INFO +342 -0
- xlsx_viewer_pro-1.0.0/README.md +303 -0
- xlsx_viewer_pro-1.0.0/asm/__init__.py +45 -0
- xlsx_viewer_pro-1.0.0/asm/asm_bridge.py +268 -0
- xlsx_viewer_pro-1.0.0/asm/test_asm.py +97 -0
- xlsx_viewer_pro-1.0.0/asm/xlsx_gui64.asm +3820 -0
- xlsx_viewer_pro-1.0.0/asm/xlsx_gui64.exe +0 -0
- xlsx_viewer_pro-1.0.0/asm/xlsx_math64.asm +509 -0
- xlsx_viewer_pro-1.0.0/asm/xlsx_math64.dll +0 -0
- xlsx_viewer_pro-1.0.0/pyproject.toml +88 -0
- xlsx_viewer_pro-1.0.0/setup.cfg +4 -0
- xlsx_viewer_pro-1.0.0/tests/test_app.py +291 -0
- xlsx_viewer_pro-1.0.0/tests/test_library_api.py +99 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/__init__.py +78 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/api.py +101 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/app_icon.ico +0 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/app_icon.png +0 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/asm/__init__.py +45 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/asm/asm_bridge.py +268 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/asm/test_asm.py +97 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/asm/xlsx_gui64.asm +3820 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/asm/xlsx_math64.asm +509 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/asm/xlsx_math64.dll +0 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/cli.py +110 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/config.py +118 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/dialogs.py +1189 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/formatting.py +252 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/formulas.py +2422 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/gui.py +2837 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/models.py +301 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer/widgets.py +1273 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer_pro.egg-info/PKG-INFO +342 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer_pro.egg-info/SOURCES.txt +37 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer_pro.egg-info/dependency_links.txt +1 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer_pro.egg-info/entry_points.txt +4 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer_pro.egg-info/requires.txt +9 -0
- xlsx_viewer_pro-1.0.0/xlsx_viewer_pro.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
๏ปฟMIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 eminsk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xlsx-viewer-pro
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Modern Excel spreadsheet engine, 129 formula functions, SIMD SSE2 math, and desktop GUI viewer.
|
|
5
|
+
Author-email: eminsk <M_N_Nik@yahoo.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/eminsk/xlsx_vievers
|
|
8
|
+
Project-URL: Repository, https://github.com/eminsk/xlsx_vievers
|
|
9
|
+
Project-URL: Issues, https://github.com/eminsk/xlsx_vievers/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/eminsk/xlsx_vievers/releases
|
|
11
|
+
Keywords: excel,xlsx,spreadsheet,formula-engine,simd,sse2,openpyxl,vlookup,xlookup,viewer,desktop-app,calculator
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
15
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Programming Language :: Assembly
|
|
25
|
+
Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
27
|
+
Requires-Python: >=3.10
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: openpyxl>=3.1.0
|
|
31
|
+
Requires-Dist: matplotlib>=3.7.0
|
|
32
|
+
Requires-Dist: ttkbootstrap>=1.10.0
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
35
|
+
Requires-Dist: ruff>=0.3.0; extra == "dev"
|
|
36
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
|
37
|
+
Requires-Dist: twine>=5.0.0; extra == "dev"
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
# xlsx-viewer-pro (Excel Viewer Pro)
|
|
41
|
+
|
|
42
|
+
[](https://pypi.org/project/xlsx-viewer-pro/)
|
|
43
|
+
[](https://pypi.org/project/xlsx-viewer-pro/)
|
|
44
|
+
[](https://opensource.org/licenses/MIT)
|
|
45
|
+
[](https://github.com/eminsk/xlsx_vievers/actions)
|
|
46
|
+
[](https://pepy.tech/project/xlsx-viewer-pro)
|
|
47
|
+
|
|
48
|
+
A high-performance Python spreadsheet library, headless formula engine (129+ functions), native x64 SIMD SSE2 math engine, and modern Office Ribbon desktop application for `.xlsx`, `.xlsm`, `.csv`, and `.tsv` files.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## โก Key Highlights
|
|
53
|
+
|
|
54
|
+
- ๐งฎ **Headless Excel Formula Engine**: Evaluate Excel formulas in pure Python without launching any UI. Supports **129 functions** across Math, Trigonometry, Statistics, Finance (`PMT`, `PV`, `FV`, `NPV`, `IRR`), Lookups (`VLOOKUP`, `XLOOKUP`, `INDEX`, `MATCH`), Text, Logic, and Date/Time.
|
|
55
|
+
- ๐ **Hardware SIMD SSE2 Acceleration**: Built-in 64-bit native assembly engine (`xlsx_math64.dll`) delivering up to **7.4+ million double-precision operations per second** with automatic pure-Python fallback on non-Windows/ARM platforms.
|
|
56
|
+
- ๐ ๏ธ **Dual-Use Architecture**: Use it as a lightweight Python library, a command-line tool (`xlsx-viewer-pro` / `xlsx-viewer` / `xv`), or a full-featured desktop spreadsheet application.
|
|
57
|
+
- ๐จ **Modern Desktop GUI**: Office Ribbon UI with dynamic real-time status bar statistics (`SUM`, `AVERAGE`, `COUNT`, `MIN`, `MAX`), 10+ chart types, conditional formatting, auto-filter, and goal seek.
|
|
58
|
+
- ๐งฉ **Zero Heavy Spreadsheet Engine Dependencies**: No LibreOffice, COM, or Excel installation required.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## ๐ฆ Installation
|
|
63
|
+
|
|
64
|
+
Install via `pip`:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install xlsx-viewer-pro
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Or via `uv`:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
uv pip install xlsx-viewer-pro
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## ๐ Python Library Quickstart
|
|
79
|
+
|
|
80
|
+
### 1. Headless Formula Evaluation
|
|
81
|
+
|
|
82
|
+
Evaluate any Excel formula directly from Python:
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
from xlsx_viewer import evaluate_formula
|
|
86
|
+
|
|
87
|
+
# Basic arithmetic & math
|
|
88
|
+
result = evaluate_formula("=SUM(10, 20, 30) * 2")
|
|
89
|
+
print(result) # 120.0
|
|
90
|
+
|
|
91
|
+
# Financial formulas
|
|
92
|
+
monthly_payment = evaluate_formula("=PMT(0.05 / 12, 360, -250000)")
|
|
93
|
+
print(f"Monthly Mortgage: ${monthly_payment:.2f}") # $1342.05
|
|
94
|
+
|
|
95
|
+
# Statistical & Logic
|
|
96
|
+
val = evaluate_formula("=IF(AVERAGE(85, 90, 92) >= 90, 'Honors', 'Standard')")
|
|
97
|
+
print(val) # 'Honors'
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 2. Evaluating Formulas with Cell Context
|
|
101
|
+
|
|
102
|
+
Pass cell coordinate mappings directly using standard Excel notation:
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from xlsx_viewer import evaluate_formula
|
|
106
|
+
|
|
107
|
+
context = {
|
|
108
|
+
"A1": 15000,
|
|
109
|
+
"A2": 3200,
|
|
110
|
+
"B1": 0.15,
|
|
111
|
+
"B2": "Tier-1",
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
# Reference cells directly
|
|
115
|
+
net_profit = evaluate_formula("=(A1 - A2) * (1 - B1)", context=context)
|
|
116
|
+
print(f"Net Profit: ${net_profit:.2f}") # $10030.00
|
|
117
|
+
|
|
118
|
+
# Text and conditional logic with context
|
|
119
|
+
status = evaluate_formula(
|
|
120
|
+
'=IF(A1 > 10000, CONCAT(B2, " - High Volume"), "Normal")',
|
|
121
|
+
context=context,
|
|
122
|
+
)
|
|
123
|
+
print(status) # 'Tier-1 - High Volume'
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 3. Using the `FormulaEngine` Class
|
|
127
|
+
|
|
128
|
+
For dynamic resolution or integrating with custom data sources:
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from xlsx_viewer import FormulaEngine
|
|
132
|
+
|
|
133
|
+
# Custom resolver: fn(row: int, col: int, sheet: str | None) -> value
|
|
134
|
+
matrix = [
|
|
135
|
+
[10, 20, 30],
|
|
136
|
+
[40, 50, 60],
|
|
137
|
+
]
|
|
138
|
+
|
|
139
|
+
def custom_resolver(row: int, col: int, sheet: str | None = None):
|
|
140
|
+
try:
|
|
141
|
+
return matrix[row][col]
|
|
142
|
+
except IndexError:
|
|
143
|
+
return 0
|
|
144
|
+
|
|
145
|
+
engine = FormulaEngine(resolver=custom_resolver)
|
|
146
|
+
result = engine.evaluate("=SUM(A1:C2) + MAX(A1:C2)")
|
|
147
|
+
print(result) # 210 + 60 = 270.0
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### 4. SIMD Hardware-Accelerated Vector Math
|
|
151
|
+
|
|
152
|
+
Leverage native 64-bit SSE2 assembly routines for high-throughput calculations:
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
from xlsx_viewer.asm import is_asm_available, simd_avg, simd_max, simd_min, simd_sum, simd_sumproduct
|
|
156
|
+
|
|
157
|
+
print("SIMD SSE2 Active:", is_asm_available())
|
|
158
|
+
|
|
159
|
+
data_a = [10.5, 20.25, 30.75, 40.0, 50.5, 60.0]
|
|
160
|
+
data_b = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
|
|
161
|
+
|
|
162
|
+
print("Sum:", simd_sum(data_a))
|
|
163
|
+
print("Average:", simd_avg(data_a))
|
|
164
|
+
print("Min / Max:", simd_min(data_a), simd_max(data_a))
|
|
165
|
+
print("Sumproduct:", simd_sumproduct(data_a, data_b))
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 5. In-Memory Workbook Data Models
|
|
169
|
+
|
|
170
|
+
Load, inspect, and manipulate Excel workbooks programmatically:
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
from xlsx_viewer import WorkbookData, load_workbook
|
|
174
|
+
|
|
175
|
+
# Load an existing workbook
|
|
176
|
+
wb = load_workbook("report.xlsx")
|
|
177
|
+
print(f"Sheets: {wb.sheet_names}")
|
|
178
|
+
|
|
179
|
+
sheet = wb.get_sheet("Sheet1")
|
|
180
|
+
print(f"Dimensions: {sheet.max_row} rows x {sheet.max_col} cols")
|
|
181
|
+
|
|
182
|
+
# Read cell values and formulas
|
|
183
|
+
cell = sheet.get_cell(row=0, col=0) # A1
|
|
184
|
+
if cell:
|
|
185
|
+
print(f"A1 Value: {cell.value}, Formula: {cell.formula}")
|
|
186
|
+
|
|
187
|
+
# Modify cells in-memory
|
|
188
|
+
sheet.set_cell(row=0, col=1, value=1250.50)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## ๐ป Command Line Interface (CLI)
|
|
194
|
+
|
|
195
|
+
`xlsx-viewer` comes with a CLI tool accessible as both `xlsx-viewer` and `xv`:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Evaluate an Excel formula from the terminal
|
|
199
|
+
xv --calc "=SUM(10, 20, 30) * 2"
|
|
200
|
+
# 120.0
|
|
201
|
+
|
|
202
|
+
# Calculate financial loan payment
|
|
203
|
+
xv -c "=PMT(0.065 / 12, 360, -350000)"
|
|
204
|
+
# 2212.24
|
|
205
|
+
|
|
206
|
+
# List all 129 supported Excel formula functions
|
|
207
|
+
xv --list-formulas
|
|
208
|
+
|
|
209
|
+
# Inspect environment and hardware SIMD acceleration status
|
|
210
|
+
xv --info
|
|
211
|
+
|
|
212
|
+
# Open a workbook in the desktop GUI
|
|
213
|
+
xv sample_report.xlsx
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## ๐ฅ๏ธ Desktop Application Features
|
|
219
|
+
|
|
220
|
+
Launch the desktop spreadsheet GUI with:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
xlsx-viewer
|
|
224
|
+
# or
|
|
225
|
+
python -m xlsx_viewer
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### ๐ Office Ribbon Navigation
|
|
229
|
+
- **Home Tab**: Undo/Redo, Clipboard (Cut, Copy, Paste, Paste Special), Font styling, Cell fill & text colors, Cell borders, Alignment & Wrap Text, Number formats (`$`, `โฌ`, `โฝ`, `%`, decimals), Conditional Formatting.
|
|
230
|
+
- **Insert Tab**: Chart Wizard (10+ chart types), Shapes, and Comments.
|
|
231
|
+
- **Data Tab**: Multi-level Sorting, AutoFilter with column search checkboxes, Remove Duplicates, Text-to-Columns, and Goal Seek.
|
|
232
|
+
- **Formulas Tab**: Function Wizard (`fx`), Precedence auditing, and calculation options (`F9`).
|
|
233
|
+
- **View Tab**: Gridline toggling, Zoom levels (50% โ 200%), and Theme switcher.
|
|
234
|
+
|
|
235
|
+
### ๐ Chart Wizard (10+ Types)
|
|
236
|
+
Interactive charts powered by Matplotlib:
|
|
237
|
+
- Column & Bar Charts
|
|
238
|
+
- Line & Area Charts
|
|
239
|
+
- Pie & Donut Charts
|
|
240
|
+
- XY Scatter Plots & Histograms
|
|
241
|
+
- Professional color palettes: *Excel Classic, Modern Teal, Vibrant, Pastel, Monochrome*.
|
|
242
|
+
|
|
243
|
+
### โจ๏ธ Keyboard Shortcuts
|
|
244
|
+
|
|
245
|
+
| Shortcut | Action |
|
|
246
|
+
|----------|--------|
|
|
247
|
+
| `Ctrl + N` | New Workbook |
|
|
248
|
+
| `Ctrl + O` | Open File |
|
|
249
|
+
| `Ctrl + S` | Save File |
|
|
250
|
+
| `Ctrl + Shift + S` | Save As... |
|
|
251
|
+
| `Ctrl + Z` / `Ctrl + Y` | Undo / Redo |
|
|
252
|
+
| `Ctrl + C` / `Ctrl + X` / `Ctrl + V` | Copy / Cut / Paste |
|
|
253
|
+
| `Ctrl + A` | Select Entire Sheet |
|
|
254
|
+
| `Ctrl + F` / `Ctrl + H` | Find / Replace |
|
|
255
|
+
| `Ctrl + G` | Go to Cell |
|
|
256
|
+
| `F2` / Double Click | In-place Cell Editor |
|
|
257
|
+
| `F9` | Recalculate All Formulas |
|
|
258
|
+
| `Shift + Arrow Keys` | Expand Cell Selection |
|
|
259
|
+
| `Tab` / `Enter` | Move Right / Down |
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## ๐งฎ Supported Formula Functions (129 Total)
|
|
264
|
+
|
|
265
|
+
<details>
|
|
266
|
+
<summary><strong>Click to expand full function list by category</strong></summary>
|
|
267
|
+
|
|
268
|
+
### ๐ Math & Trigonometry (33)
|
|
269
|
+
`SUM`, `SUMIF`, `SUMIFS`, `PRODUCT`, `ROUND`, `ROUNDUP`, `ROUNDDOWN`, `INT`, `TRUNC`, `ABS`, `MOD`, `POWER`, `SQRT`, `PI`, `RAND`, `RANDBETWEEN`, `CEILING`, `FLOOR`, `SIGN`, `SIN`, `COS`, `TAN`, `ASIN`, `ACOS`, `ATAN`, `DEGREES`, `RADIANS`, `EXP`, `LN`, `LOG`, `LOG10`, `FACT`, `SUMPRODUCT`
|
|
270
|
+
|
|
271
|
+
### ๐ Statistical (20)
|
|
272
|
+
`AVERAGE`, `AVERAGEA`, `AVERAGEIF`, `AVERAGEIFS`, `COUNT`, `COUNTA`, `COUNTBLANK`, `COUNTIF`, `COUNTIFS`, `MIN`, `MINIFS`, `MAX`, `MAXIFS`, `MEDIAN`, `MODE`, `STDEV`, `STDEVP`, `VAR`, `VARP`, `LARGE`, `SMALL`, `RANK`
|
|
273
|
+
|
|
274
|
+
### ๐ฐ Financial (9)
|
|
275
|
+
`PMT`, `PV`, `FV`, `RATE`, `NPER`, `NPV`, `IRR`, `SLN`, `SYD`
|
|
276
|
+
|
|
277
|
+
### ๐ Lookup & Reference (11)
|
|
278
|
+
`VLOOKUP`, `HLOOKUP`, `XLOOKUP`, `INDEX`, `MATCH`, `LOOKUP`, `CHOOSE`, `ROW`, `COLUMN`, `ROWS`, `COLUMNS`
|
|
279
|
+
|
|
280
|
+
### ๐ค Text (23)
|
|
281
|
+
`CONCAT`, `CONCATENATE`, `TEXTJOIN`, `LEFT`, `RIGHT`, `MID`, `LEN`, `TRIM`, `UPPER`, `LOWER`, `PROPER`, `EXACT`, `FIND`, `SEARCH`, `REPLACE`, `SUBSTITUTE`, `REPT`, `TEXT`, `VALUE`, `CHAR`, `CODE`, `CLEAN`, `T`
|
|
282
|
+
|
|
283
|
+
### โ๏ธ Logical (11)
|
|
284
|
+
`IF`, `IFS`, `SWITCH`, `AND`, `OR`, `NOT`, `XOR`, `IFERROR`, `IFNA`, `TRUE`, `FALSE`
|
|
285
|
+
|
|
286
|
+
### ๐
Date & Time (11)
|
|
287
|
+
`TODAY`, `NOW`, `DATE`, `TIME`, `YEAR`, `MONTH`, `DAY`, `DAYS`, `EDATE`, `EOMONTH`, `WEEKDAY`
|
|
288
|
+
|
|
289
|
+
### โน๏ธ Information (10)
|
|
290
|
+
`ISBLANK`, `ISNUMBER`, `ISTEXT`, `ISNONTEXT`, `ISLOGICAL`, `ISERROR`, `ISERR`, `ISNA`, `TYPE`, `N`
|
|
291
|
+
|
|
292
|
+
</details>
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## ๐๏ธ Architecture
|
|
297
|
+
|
|
298
|
+
```
|
|
299
|
+
xlsx-viewer/
|
|
300
|
+
โโโ xlsx_viewer/ # Core Library Package
|
|
301
|
+
โ โโโ __init__.py # Public API exports
|
|
302
|
+
โ โโโ api.py # evaluate_formula, load_workbook, launch_gui
|
|
303
|
+
โ โโโ cli.py # CLI entrypoint (xlsx-viewer / xv)
|
|
304
|
+
โ โโโ formulas.py # Headless formula evaluation engine (129 functions)
|
|
305
|
+
โ โโโ models.py # In-memory workbook, sheet, cell, and formatting models
|
|
306
|
+
โ โโโ formatting.py # Number, date, currency, and conditional formatting
|
|
307
|
+
โ โโโ widgets.py # Tkinter / ttkbootstrap UI widgets (Ribbon, Sheet, Grid)
|
|
308
|
+
โ โโโ dialogs.py # Wizards (Chart, Function, Filter, Goal Seek)
|
|
309
|
+
โ โโโ config.py # Styling, themes, and configuration
|
|
310
|
+
โ โโโ asm/ # Hardware acceleration
|
|
311
|
+
โ โโโ xlsx_math64.dll # Native x64 SSE2 assembly DLL
|
|
312
|
+
โ โโโ asm_bridge.py # ctypes bridge with fallback
|
|
313
|
+
โโโ tests/ # Integration and Unit Test Suite (29 tests)
|
|
314
|
+
โ โโโ test_app.py
|
|
315
|
+
โ โโโ test_library_api.py
|
|
316
|
+
โโโ pyproject.toml # PEP 517 / 621 Build Specification
|
|
317
|
+
โโโ README.md
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## ๐งช Running Tests
|
|
323
|
+
|
|
324
|
+
Run the test suite with pytest:
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
uv run pytest -v
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
All 29 tests pass with 100% success rate on Python 3.10 through 3.14.
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## ๐ License
|
|
335
|
+
|
|
336
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## ๐ค Author
|
|
341
|
+
|
|
342
|
+
Developed by **eminsk** ([GitHub](https://github.com/eminsk)) โข [M_N_Nik@yahoo.com](mailto:M_N_Nik@yahoo.com)
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
# xlsx-viewer-pro (Excel Viewer Pro)
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/xlsx-viewer-pro/)
|
|
4
|
+
[](https://pypi.org/project/xlsx-viewer-pro/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://github.com/eminsk/xlsx_vievers/actions)
|
|
7
|
+
[](https://pepy.tech/project/xlsx-viewer-pro)
|
|
8
|
+
|
|
9
|
+
A high-performance Python spreadsheet library, headless formula engine (129+ functions), native x64 SIMD SSE2 math engine, and modern Office Ribbon desktop application for `.xlsx`, `.xlsm`, `.csv`, and `.tsv` files.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## โก Key Highlights
|
|
14
|
+
|
|
15
|
+
- ๐งฎ **Headless Excel Formula Engine**: Evaluate Excel formulas in pure Python without launching any UI. Supports **129 functions** across Math, Trigonometry, Statistics, Finance (`PMT`, `PV`, `FV`, `NPV`, `IRR`), Lookups (`VLOOKUP`, `XLOOKUP`, `INDEX`, `MATCH`), Text, Logic, and Date/Time.
|
|
16
|
+
- ๐ **Hardware SIMD SSE2 Acceleration**: Built-in 64-bit native assembly engine (`xlsx_math64.dll`) delivering up to **7.4+ million double-precision operations per second** with automatic pure-Python fallback on non-Windows/ARM platforms.
|
|
17
|
+
- ๐ ๏ธ **Dual-Use Architecture**: Use it as a lightweight Python library, a command-line tool (`xlsx-viewer-pro` / `xlsx-viewer` / `xv`), or a full-featured desktop spreadsheet application.
|
|
18
|
+
- ๐จ **Modern Desktop GUI**: Office Ribbon UI with dynamic real-time status bar statistics (`SUM`, `AVERAGE`, `COUNT`, `MIN`, `MAX`), 10+ chart types, conditional formatting, auto-filter, and goal seek.
|
|
19
|
+
- ๐งฉ **Zero Heavy Spreadsheet Engine Dependencies**: No LibreOffice, COM, or Excel installation required.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ๐ฆ Installation
|
|
24
|
+
|
|
25
|
+
Install via `pip`:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install xlsx-viewer-pro
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or via `uv`:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
uv pip install xlsx-viewer-pro
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## ๐ Python Library Quickstart
|
|
40
|
+
|
|
41
|
+
### 1. Headless Formula Evaluation
|
|
42
|
+
|
|
43
|
+
Evaluate any Excel formula directly from Python:
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from xlsx_viewer import evaluate_formula
|
|
47
|
+
|
|
48
|
+
# Basic arithmetic & math
|
|
49
|
+
result = evaluate_formula("=SUM(10, 20, 30) * 2")
|
|
50
|
+
print(result) # 120.0
|
|
51
|
+
|
|
52
|
+
# Financial formulas
|
|
53
|
+
monthly_payment = evaluate_formula("=PMT(0.05 / 12, 360, -250000)")
|
|
54
|
+
print(f"Monthly Mortgage: ${monthly_payment:.2f}") # $1342.05
|
|
55
|
+
|
|
56
|
+
# Statistical & Logic
|
|
57
|
+
val = evaluate_formula("=IF(AVERAGE(85, 90, 92) >= 90, 'Honors', 'Standard')")
|
|
58
|
+
print(val) # 'Honors'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 2. Evaluating Formulas with Cell Context
|
|
62
|
+
|
|
63
|
+
Pass cell coordinate mappings directly using standard Excel notation:
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from xlsx_viewer import evaluate_formula
|
|
67
|
+
|
|
68
|
+
context = {
|
|
69
|
+
"A1": 15000,
|
|
70
|
+
"A2": 3200,
|
|
71
|
+
"B1": 0.15,
|
|
72
|
+
"B2": "Tier-1",
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
# Reference cells directly
|
|
76
|
+
net_profit = evaluate_formula("=(A1 - A2) * (1 - B1)", context=context)
|
|
77
|
+
print(f"Net Profit: ${net_profit:.2f}") # $10030.00
|
|
78
|
+
|
|
79
|
+
# Text and conditional logic with context
|
|
80
|
+
status = evaluate_formula(
|
|
81
|
+
'=IF(A1 > 10000, CONCAT(B2, " - High Volume"), "Normal")',
|
|
82
|
+
context=context,
|
|
83
|
+
)
|
|
84
|
+
print(status) # 'Tier-1 - High Volume'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 3. Using the `FormulaEngine` Class
|
|
88
|
+
|
|
89
|
+
For dynamic resolution or integrating with custom data sources:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
from xlsx_viewer import FormulaEngine
|
|
93
|
+
|
|
94
|
+
# Custom resolver: fn(row: int, col: int, sheet: str | None) -> value
|
|
95
|
+
matrix = [
|
|
96
|
+
[10, 20, 30],
|
|
97
|
+
[40, 50, 60],
|
|
98
|
+
]
|
|
99
|
+
|
|
100
|
+
def custom_resolver(row: int, col: int, sheet: str | None = None):
|
|
101
|
+
try:
|
|
102
|
+
return matrix[row][col]
|
|
103
|
+
except IndexError:
|
|
104
|
+
return 0
|
|
105
|
+
|
|
106
|
+
engine = FormulaEngine(resolver=custom_resolver)
|
|
107
|
+
result = engine.evaluate("=SUM(A1:C2) + MAX(A1:C2)")
|
|
108
|
+
print(result) # 210 + 60 = 270.0
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 4. SIMD Hardware-Accelerated Vector Math
|
|
112
|
+
|
|
113
|
+
Leverage native 64-bit SSE2 assembly routines for high-throughput calculations:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from xlsx_viewer.asm import is_asm_available, simd_avg, simd_max, simd_min, simd_sum, simd_sumproduct
|
|
117
|
+
|
|
118
|
+
print("SIMD SSE2 Active:", is_asm_available())
|
|
119
|
+
|
|
120
|
+
data_a = [10.5, 20.25, 30.75, 40.0, 50.5, 60.0]
|
|
121
|
+
data_b = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
|
|
122
|
+
|
|
123
|
+
print("Sum:", simd_sum(data_a))
|
|
124
|
+
print("Average:", simd_avg(data_a))
|
|
125
|
+
print("Min / Max:", simd_min(data_a), simd_max(data_a))
|
|
126
|
+
print("Sumproduct:", simd_sumproduct(data_a, data_b))
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 5. In-Memory Workbook Data Models
|
|
130
|
+
|
|
131
|
+
Load, inspect, and manipulate Excel workbooks programmatically:
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from xlsx_viewer import WorkbookData, load_workbook
|
|
135
|
+
|
|
136
|
+
# Load an existing workbook
|
|
137
|
+
wb = load_workbook("report.xlsx")
|
|
138
|
+
print(f"Sheets: {wb.sheet_names}")
|
|
139
|
+
|
|
140
|
+
sheet = wb.get_sheet("Sheet1")
|
|
141
|
+
print(f"Dimensions: {sheet.max_row} rows x {sheet.max_col} cols")
|
|
142
|
+
|
|
143
|
+
# Read cell values and formulas
|
|
144
|
+
cell = sheet.get_cell(row=0, col=0) # A1
|
|
145
|
+
if cell:
|
|
146
|
+
print(f"A1 Value: {cell.value}, Formula: {cell.formula}")
|
|
147
|
+
|
|
148
|
+
# Modify cells in-memory
|
|
149
|
+
sheet.set_cell(row=0, col=1, value=1250.50)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## ๐ป Command Line Interface (CLI)
|
|
155
|
+
|
|
156
|
+
`xlsx-viewer` comes with a CLI tool accessible as both `xlsx-viewer` and `xv`:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Evaluate an Excel formula from the terminal
|
|
160
|
+
xv --calc "=SUM(10, 20, 30) * 2"
|
|
161
|
+
# 120.0
|
|
162
|
+
|
|
163
|
+
# Calculate financial loan payment
|
|
164
|
+
xv -c "=PMT(0.065 / 12, 360, -350000)"
|
|
165
|
+
# 2212.24
|
|
166
|
+
|
|
167
|
+
# List all 129 supported Excel formula functions
|
|
168
|
+
xv --list-formulas
|
|
169
|
+
|
|
170
|
+
# Inspect environment and hardware SIMD acceleration status
|
|
171
|
+
xv --info
|
|
172
|
+
|
|
173
|
+
# Open a workbook in the desktop GUI
|
|
174
|
+
xv sample_report.xlsx
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## ๐ฅ๏ธ Desktop Application Features
|
|
180
|
+
|
|
181
|
+
Launch the desktop spreadsheet GUI with:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
xlsx-viewer
|
|
185
|
+
# or
|
|
186
|
+
python -m xlsx_viewer
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### ๐ Office Ribbon Navigation
|
|
190
|
+
- **Home Tab**: Undo/Redo, Clipboard (Cut, Copy, Paste, Paste Special), Font styling, Cell fill & text colors, Cell borders, Alignment & Wrap Text, Number formats (`$`, `โฌ`, `โฝ`, `%`, decimals), Conditional Formatting.
|
|
191
|
+
- **Insert Tab**: Chart Wizard (10+ chart types), Shapes, and Comments.
|
|
192
|
+
- **Data Tab**: Multi-level Sorting, AutoFilter with column search checkboxes, Remove Duplicates, Text-to-Columns, and Goal Seek.
|
|
193
|
+
- **Formulas Tab**: Function Wizard (`fx`), Precedence auditing, and calculation options (`F9`).
|
|
194
|
+
- **View Tab**: Gridline toggling, Zoom levels (50% โ 200%), and Theme switcher.
|
|
195
|
+
|
|
196
|
+
### ๐ Chart Wizard (10+ Types)
|
|
197
|
+
Interactive charts powered by Matplotlib:
|
|
198
|
+
- Column & Bar Charts
|
|
199
|
+
- Line & Area Charts
|
|
200
|
+
- Pie & Donut Charts
|
|
201
|
+
- XY Scatter Plots & Histograms
|
|
202
|
+
- Professional color palettes: *Excel Classic, Modern Teal, Vibrant, Pastel, Monochrome*.
|
|
203
|
+
|
|
204
|
+
### โจ๏ธ Keyboard Shortcuts
|
|
205
|
+
|
|
206
|
+
| Shortcut | Action |
|
|
207
|
+
|----------|--------|
|
|
208
|
+
| `Ctrl + N` | New Workbook |
|
|
209
|
+
| `Ctrl + O` | Open File |
|
|
210
|
+
| `Ctrl + S` | Save File |
|
|
211
|
+
| `Ctrl + Shift + S` | Save As... |
|
|
212
|
+
| `Ctrl + Z` / `Ctrl + Y` | Undo / Redo |
|
|
213
|
+
| `Ctrl + C` / `Ctrl + X` / `Ctrl + V` | Copy / Cut / Paste |
|
|
214
|
+
| `Ctrl + A` | Select Entire Sheet |
|
|
215
|
+
| `Ctrl + F` / `Ctrl + H` | Find / Replace |
|
|
216
|
+
| `Ctrl + G` | Go to Cell |
|
|
217
|
+
| `F2` / Double Click | In-place Cell Editor |
|
|
218
|
+
| `F9` | Recalculate All Formulas |
|
|
219
|
+
| `Shift + Arrow Keys` | Expand Cell Selection |
|
|
220
|
+
| `Tab` / `Enter` | Move Right / Down |
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## ๐งฎ Supported Formula Functions (129 Total)
|
|
225
|
+
|
|
226
|
+
<details>
|
|
227
|
+
<summary><strong>Click to expand full function list by category</strong></summary>
|
|
228
|
+
|
|
229
|
+
### ๐ Math & Trigonometry (33)
|
|
230
|
+
`SUM`, `SUMIF`, `SUMIFS`, `PRODUCT`, `ROUND`, `ROUNDUP`, `ROUNDDOWN`, `INT`, `TRUNC`, `ABS`, `MOD`, `POWER`, `SQRT`, `PI`, `RAND`, `RANDBETWEEN`, `CEILING`, `FLOOR`, `SIGN`, `SIN`, `COS`, `TAN`, `ASIN`, `ACOS`, `ATAN`, `DEGREES`, `RADIANS`, `EXP`, `LN`, `LOG`, `LOG10`, `FACT`, `SUMPRODUCT`
|
|
231
|
+
|
|
232
|
+
### ๐ Statistical (20)
|
|
233
|
+
`AVERAGE`, `AVERAGEA`, `AVERAGEIF`, `AVERAGEIFS`, `COUNT`, `COUNTA`, `COUNTBLANK`, `COUNTIF`, `COUNTIFS`, `MIN`, `MINIFS`, `MAX`, `MAXIFS`, `MEDIAN`, `MODE`, `STDEV`, `STDEVP`, `VAR`, `VARP`, `LARGE`, `SMALL`, `RANK`
|
|
234
|
+
|
|
235
|
+
### ๐ฐ Financial (9)
|
|
236
|
+
`PMT`, `PV`, `FV`, `RATE`, `NPER`, `NPV`, `IRR`, `SLN`, `SYD`
|
|
237
|
+
|
|
238
|
+
### ๐ Lookup & Reference (11)
|
|
239
|
+
`VLOOKUP`, `HLOOKUP`, `XLOOKUP`, `INDEX`, `MATCH`, `LOOKUP`, `CHOOSE`, `ROW`, `COLUMN`, `ROWS`, `COLUMNS`
|
|
240
|
+
|
|
241
|
+
### ๐ค Text (23)
|
|
242
|
+
`CONCAT`, `CONCATENATE`, `TEXTJOIN`, `LEFT`, `RIGHT`, `MID`, `LEN`, `TRIM`, `UPPER`, `LOWER`, `PROPER`, `EXACT`, `FIND`, `SEARCH`, `REPLACE`, `SUBSTITUTE`, `REPT`, `TEXT`, `VALUE`, `CHAR`, `CODE`, `CLEAN`, `T`
|
|
243
|
+
|
|
244
|
+
### โ๏ธ Logical (11)
|
|
245
|
+
`IF`, `IFS`, `SWITCH`, `AND`, `OR`, `NOT`, `XOR`, `IFERROR`, `IFNA`, `TRUE`, `FALSE`
|
|
246
|
+
|
|
247
|
+
### ๐
Date & Time (11)
|
|
248
|
+
`TODAY`, `NOW`, `DATE`, `TIME`, `YEAR`, `MONTH`, `DAY`, `DAYS`, `EDATE`, `EOMONTH`, `WEEKDAY`
|
|
249
|
+
|
|
250
|
+
### โน๏ธ Information (10)
|
|
251
|
+
`ISBLANK`, `ISNUMBER`, `ISTEXT`, `ISNONTEXT`, `ISLOGICAL`, `ISERROR`, `ISERR`, `ISNA`, `TYPE`, `N`
|
|
252
|
+
|
|
253
|
+
</details>
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## ๐๏ธ Architecture
|
|
258
|
+
|
|
259
|
+
```
|
|
260
|
+
xlsx-viewer/
|
|
261
|
+
โโโ xlsx_viewer/ # Core Library Package
|
|
262
|
+
โ โโโ __init__.py # Public API exports
|
|
263
|
+
โ โโโ api.py # evaluate_formula, load_workbook, launch_gui
|
|
264
|
+
โ โโโ cli.py # CLI entrypoint (xlsx-viewer / xv)
|
|
265
|
+
โ โโโ formulas.py # Headless formula evaluation engine (129 functions)
|
|
266
|
+
โ โโโ models.py # In-memory workbook, sheet, cell, and formatting models
|
|
267
|
+
โ โโโ formatting.py # Number, date, currency, and conditional formatting
|
|
268
|
+
โ โโโ widgets.py # Tkinter / ttkbootstrap UI widgets (Ribbon, Sheet, Grid)
|
|
269
|
+
โ โโโ dialogs.py # Wizards (Chart, Function, Filter, Goal Seek)
|
|
270
|
+
โ โโโ config.py # Styling, themes, and configuration
|
|
271
|
+
โ โโโ asm/ # Hardware acceleration
|
|
272
|
+
โ โโโ xlsx_math64.dll # Native x64 SSE2 assembly DLL
|
|
273
|
+
โ โโโ asm_bridge.py # ctypes bridge with fallback
|
|
274
|
+
โโโ tests/ # Integration and Unit Test Suite (29 tests)
|
|
275
|
+
โ โโโ test_app.py
|
|
276
|
+
โ โโโ test_library_api.py
|
|
277
|
+
โโโ pyproject.toml # PEP 517 / 621 Build Specification
|
|
278
|
+
โโโ README.md
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## ๐งช Running Tests
|
|
284
|
+
|
|
285
|
+
Run the test suite with pytest:
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
uv run pytest -v
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
All 29 tests pass with 100% success rate on Python 3.10 through 3.14.
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## ๐ License
|
|
296
|
+
|
|
297
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## ๐ค Author
|
|
302
|
+
|
|
303
|
+
Developed by **eminsk** ([GitHub](https://github.com/eminsk)) โข [M_N_Nik@yahoo.com](mailto:M_N_Nik@yahoo.com)
|