Operators can double-click XlsxClean without using the terminal: Windows VBS/BAT launchers plus Install-DesktopShortcut, Linux .desktop installer, and a PyInstaller spec/build script for a standalone Windows exe. Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
3.1 KiB
3.1 KiB
xlsx-clean
xlsx-clean generates a new Excel QC datasheet from the most recent workbook in a
configured directory, clearing/resetting specific cells. Interfaces:
- CLI:
src/xlsx_clean/clean_cells.py(beaupy) - Web UI:
src/xlsx_clean/web_app.py(NiceGUI athttp://127.0.0.1:8080)
Backends
com(Windows default): Microsoft Excel COM viapywin32. Loads add-ins listed instrings.txt, edits cells,SaveAs, leaves Excel visible/maximized.ooxml(Linux/macOS default): Surgical edit of the.xlsxzip (worksheet XML only). Preserves non-worksheet parts (styles, connections/Power Query definitions, drawings, etc.). Does not calculate formulas or refresh queries.
Select with --backend com|ooxml (CLI) or the Backend dropdown (web UI).
Cursor Cloud specific instructions
Platform notes
pywin32has no Linux wheels and is declared as Windows-only (pywin32>=306; sys_platform == 'win32'). It is intentionally not installed here.- End-to-end COM automation needs Windows + desktop Excel and does not run on this VM.
- On Linux, the ooxml backend can clear/set cells and write a new workbook when
sample files and
XLSX_CLEAN_ROOTpoint at a real tree. Without those data files, interactive selection still works for config loading, but globbing finds no templates. - NiceGUI web UI runs on Linux;
show=Truemay try to open a browser (harmless if headless).
Environment
- Dependencies are installed into a
uv-managed virtualenv at.venvby the startup update script (uvitself is installed viapip install --break-system-packages uvand lives in~/.local/bin, which is on PATH for interactive shells via~/.bashrc). - The install uses pinned versions from
requirements.lock, excluding the-e file:.editable line andpywin32; the package is then installed editable with--no-deps. Also installnicegui(and its deps) for the web UI:uv pip install 'nicegui>=2.5.0' -p .venv/bin/python. - Run Python via the venv interpreter:
.venv/bin/python. - Optional:
XLSX_CLEAN_ROOTremapsD:\OpenCloud\...paths fromfile_data.csv.
Lint / test / build
- There is no lint config, no test suite, and no build step in this repo (no ruff/flake8, no pytest, no CI). Don't invent one unless asked.
pyproject.tomluseshatchlingas the build backend; there is nothing to "build" for dev.
Running / verifying
- CLI:
.venv/bin/python -m xlsx_clean.clean_cells(defaults toooxmlon Linux). - Web UI:
.venv/bin/python -m xlsx_clean.web_app --port 8080then openhttp://127.0.0.1:8080. - Desktop shortcut (Linux):
.venv/bin/python desktop/install_desktop_shortcut.py - Windows shop-floor: use
desktop/Install-DesktopShortcut.bator build an exe withdesktop/build_windows_exe.baton a Windows PC (cannot build Windows exe here). - Sanity-check imports:
.venv/bin/python -c "import pandas, beaupy, nicegui; from xlsx_clean import hello; from xlsx_clean.ooxml_backend import expand_a1_range; print(hello(), expand_a1_range('A1:B2'))". - Note: the
uv-created.venvdoes not includepip; useuv pip ...for package operations.