Skip to content

v0.9.0

Latest

Choose a tag to compare

@harumiWeb harumiWeb released this 04 Oct 02:40
9cdf9aa

ExStruct v0.9.0

ExStruct v0.9.0 is a major performance-focused release that substantially reduces extraction latency, memory usage, repeated workbook parsing, and unnecessary heavy dependency loading.

The biggest change is a new direct OOXML extraction path for light mode. Supported .xlsx and .xlsm files can now be read directly from the workbook ZIP package without loading openpyxl, xlwings, pandas, or SciPy on the normal path.

This release also significantly improves verbose color extraction by avoiding thousands of unnecessary per-cell Excel COM calls while preserving Excel-rendered conditional formatting semantics.

Highlights

Direct OOXML extraction for light mode

light mode now uses a shared direct OOXML extraction session for supported .xlsx and .xlsm workbooks.

The new path extracts:

  • cells and shared strings
  • formulas
  • hyperlinks
  • merged cells
  • print areas
  • explicit and heuristic table candidates
  • shapes and connectors
  • charts

A normal light extraction now opens the workbook archive once and does not import:

  • openpyxl
  • xlwings
  • pandas
  • SciPy

If the direct OOXML reader encounters unsupported workbook content, ExStruct safely discards the partial result and restarts extraction through the existing openpyxl compatibility path.

Much faster light extraction

Representative local Windows benchmarks showed substantial improvements while producing identical serialized output.

Fixture Previous light v0.9.0
24-sheet workbook 4102 ms 120 ms
Large workbook 1596 ms 596 ms
Style-heavy workbook 535 ms 178 ms
Table-heavy workbook 242 ms 72 ms

After switching the default light path fully to direct OOXML, additional cold-start improvements were observed:

Fixture openpyxl path OOXML path
Small 983 ms 428 ms
Sparse 823 ms 254 ms
24 sheets 840 ms 333 ms
Large / 60,000 cells 1626 ms 1060 ms

Peak Python memory usage was also lower across all measured light-mode fixtures.

These are local benchmark results and should not be interpreted as universal timing guarantees.

Faster verbose color extraction

Previously, rendered background-color extraction queried Excel's DisplayFormat separately for every cell in the used range.

v0.9.0 introduces a hybrid strategy:

  • ordinary saved RGB fills are read directly from workbook styles
  • Excel COM is used only for conditional-formatting candidates and ambiguous cases
  • unsupported or unsafe cases fall back to the previous full COM scan

On the measured 300 × 20-cell fixtures:

Fixture DisplayFormat calls Legacy v0.9.0
Static fills 6,000 → 0 15.5–18.7 s 0.084–0.100 s
Sparse conditional formatting 6,000 → 30 12.8–17.0 s 0.144–0.208 s

All 24 paired color-map comparisons in the benchmark matched exactly.

Excel remains the source of truth for rendered conditional-formatting colors; ExStruct does not attempt to reimplement Excel's conditional-formatting engine.

Other performance improvements

Removed pandas from production extraction

Cell extraction no longer converts worksheets through pandas DataFrames.

The production path now reads worksheet data directly while preserving existing:

  • value normalization
  • dates
  • cached formula values
  • hyperlinks
  • sparse-row behavior
  • serialized output

pandas is now a development/benchmark dependency rather than a production extraction dependency.

Shared openpyxl extraction sessions

Compatibility extraction now reuses an extraction-scoped openpyxl workbook instead of repeatedly reopening the same file.

For multi-sheet workbooks, this removes a major source of redundant ZIP parsing and workbook object construction.

Formula extraction still opens a separate data_only=False workbook only when required.

SciPy is now optional

SciPy has moved out of the mandatory dependency set.

Install the optional accelerator with:

pip install "exstruct[fast]"

Without SciPy, ExStruct continues to use its Python border-clustering implementation.

Lighter backend imports

COM and rendering implementations are now loaded lazily.

Light extraction no longer pays the import cost for Excel automation backends that it does not use.

Reliability improvements

  • Fixed a lifecycle issue where a newly created Excel instance could remain running if workbook opening failed.
  • Existing/borrowed Excel applications and workbooks remain under caller ownership.
  • OOXML fallback restarts the complete compatibility extraction rather than mixing partial results from multiple backends.
  • Sparse worksheets no longer materialize large numbers of blank cells during extraction.
  • Improved handling of relocated OOXML workbook/drawing parts.
  • Preserved rich/plain shared-string segment ordering.
  • Reduced repeated merge and hyperlink scans for sparse worksheets.

COM-first evaluation

As part of this release, a bulk COM-based cell extraction path was prototyped and benchmarked for standard and verbose modes.

It was not adopted as the public default.

The experiment showed no consistent performance advantage and introduced semantic differences for:

  • Excel dates represented through Value2
  • formula recalculation
  • missing formula caches
  • unsaved workbook edits

ExStruct therefore continues to use the current saved-file-first architecture for standard and verbose extraction.

Compatibility

v0.9.0 is intended to preserve the existing public extraction output contract.

Performance work was validated with output-parity tests across representative workbooks, including cells, formulas, links, tables, merged ranges, shapes, charts, and color maps.

Unsupported direct OOXML cases continue to use the existing compatibility backend automatically.

Installation

pip install -U exstruct

Optional SciPy acceleration:

pip install -U "exstruct[fast]"

Summary

v0.9.0 changes ExStruct's extraction architecture from:

repeated workbook parsing
+ heavyweight intermediate readers
+ eager backend imports
+ per-cell COM formatting calls

to:

shared extraction sessions
+ direct OOXML where possible
+ lazy compatibility backends
+ targeted COM only where Excel rendering is required

The result is significantly faster and lighter extraction while retaining compatibility with the existing ExStruct output model.