Repository navigation
0.2.1
It uses the Rust core 0.2.1.
Changed
- Loading no longer stops real workbooks at limits meant for hostile files.
The old limits rejected, for example, files with more than 1,024 sheets or
16,384 parts, 16 MiB of styles or names, or a cell over 64 KiB. The guards
that remain stop ZIP bombs, deeply nested XML and huge XML tokens, and the
default opens every file Excel writes.
Added
load_workbook(..., limits=...)takes"strict"for uploads from
strangers,"unlimited"for files you trust, or aResourceLimits.
ResourceLimits.strict()andResourceLimits.unlimited()give the presets,
and theCRABXL_LIMITSenvironment variable sets the preset for code that
cannot pass arguments, such as pandas.max_expansion_ratiostops ZIP bombs: an entry larger than 1 MiB may
expand at most 100 times.crabxl.LimitExceededError, aValueError, says which guard a file
exceeded and how to relax it.
Fixed
iter_rowswith all four limits no longer scans every cell of the sheet,
and assigning a font, fill, border or alignment no longer imports the
style module each time. Styling each appended row of a 34,000-row
workbook took about 1.5 times as long as in openpyxl; it is now slightly
faster than openpyxl.- Reading and writing cells one at a time does less work per cell. Reading
cell.valueno longer imports modules,ws.cell(row, column, value)
writes the cell once instead of twice, and checking text for illegal
characters no longer loops over every character in Python. - Reading a cell's font, fill, border, alignment or protection took about
three times as long as in openpyxl, and creating a newFontor
Alignmentfor each cell about 1.7 times. Both now take about as long as
in openpyxl. - On Windows, saving a workbook over a file that a loaded workbook still had
open failed with "access denied". It now replaces the file.