Skip to content

Releases

crabxl-bindings 0.6.1

Choose a tag to compare

@github-actions github-actions released this 02 Dec 06:08
22a1f70

It uses the Rust core 0.4.2.

Changed

  • Reading and writing large workbooks is faster, from the Rust core's
    faster readers and writers.

Fixed

  • Unstyled date and time cells written by the streaming writer share one
    style instead of creating one per cell.

crabxl-openpyxl 0.6.0

Choose a tag to compare

@github-actions github-actions released this 28 Nov 05:10
e7d005c

Added

  • The first release as a package of its own. Until crabxl 0.5.0, this
    interface was crabxl.openpyxl in the crabxl package; its version numbers
    continue from there.
  • It supports Python 3.9 and newer. Import crabxl_openpyxl in place of
    openpyxl. With pip install "crabxl[openpyxl]" on Python 3.13 or newer,
    crabxl.openpyxl is the same module.
  • The wheel includes the openpyxl license for the code adapted from openpyxl.

crabxl-bindings 0.6.0

Choose a tag to compare

@github-actions github-actions released this 28 Nov 05:10
e7d005c

It uses the Rust core 0.4.1.

Added

  • The first release as a package of its own: the native module of crabxl
    0.6.0, for CPython 3.9 to 3.15. Its version numbers continue from crabxl.

crabxl 0.6.0

Choose a tag to compare

@github-actions github-actions released this 28 Nov 05:10
e7d005c

Changed

  • CrabXL needs Python 3.13 or newer.
  • The openpyxl interface is the new package crabxl-openpyxl, which supports
    Python 3.9 and newer. Install it with pip install "crabxl[openpyxl]" to
    keep using crabxl.openpyxl, which is the module crabxl_openpyxl: its
    submodules and classes are the same objects.
  • The native module is the new package crabxl-bindings, a dependency of
    crabxl, so the crabxl wheel is pure Python.
  • Workbook.open, Reader.open, Writer.create and every with block are
    typed to return the class they are called on, so a subclass gets its own
    type.
  • DataValidation.list is typed to accept numbers, which it saves as text.
  • Reading Workbook.properties raises FileFormatError when the file holds
    an unreadable created or modified date, instead of returning None as if
    the date were missing.
  • name in book.defined_names checks workbook-wide names only, like indexing
    and remove. Names limited to one sheet are still in the iteration.
  • A closed Reader raises StateError from sheet_names too.
  • RowSpan.hide() and ColumnSpan.hide() are now the hidden property,
    which also reads whether a row or column is hidden:
    sheet.columns("D").hidden = True.

Fixed

  • Workbook.to_bytes, and saving or finishing into a binary file, no longer
    copy the file contents once more.

0.5.0

Choose a tag to compare

@github-actions github-actions released this 26 Nov 11:09
d7ce846

It uses the Rust core 0.4.0.

Changed

  • CrabXL needs Python 3.12 or newer. The public type aliases use the
    type statement (PEP 695).
  • A chart no longer holds its place: sheet.charts.add(chart, at="E2:L18"),
    as for pictures. Chart takes the kind, the series and the options.
    Iterating sheet.charts gives PlacedChart values.
  • Rows and Columns are now RowSpan and ColumnSpan, so they differ
    from Row, a row that Reader reads.
  • A streaming sheet uses the collections of a workbook sheet:
    sheet.merges.add(...), sheet.validations.add(...) and
    sheet.conditional_formats.add(...) replace merge, add_validation
    and add_conditional_format.
  • freeze_panes and columns(...).width of a streaming sheet read back the
    values you set, instead of None.
  • from crabxl import load_workbook and the other openpyxl names now raise
    a plain ImportError. Import them from crabxl.openpyxl.

Added

  • Workbook.open and Reader.open accept any bytes-like object, such as
    bytearray, memoryview or mmap.
  • The worksheet collections of Reader and Writer are public types,
    WorksheetReaders and WorksheetWriters, with a names property.
  • Source, Target, Limits, Numbers, Dates and Visibility are
    exported for type annotations.

0.4.0

Choose a tag to compare

@github-actions github-actions released this 25 Nov 14:33
ccbb8c2

It uses the Rust core 0.4.0.

Changed

  • Tables, validations and conditional formats read back as the values you
    add: iterating sheet.validations gives DataValidation values, and
    sheet.conditional_formats gives ConditionalFormat values, instead of
    tuples. Validation bounds read as numbers and list choices as a tuple.
  • ConditionalFormat takes ranges= like DataValidation, and can apply
    to several ranges: ConditionalFormat.cell(">", 5, ranges="B2:B9", ...).
  • DataValidation.list stores its choices as a tuple, so rules are hashable.
    list_from and custom drop a leading =.
  • Properties.created and Properties.modified are timezone-aware
    datetime values. Assigning a naive datetime raises InvalidInputError.
  • Table.totals_row takes part in equality.

Added

  • Charts: sheet.charts adds, reads and removes column, bar, line, area,
    pie, doughnut and scatter charts made of Series.
  • Printing: sheet.page_setup reads and sets a PageSetup with orientation,
    paper size, scale, fit to pages, Margins, centering, grid lines, print
    area and repeated title rows and columns.
  • sheet.auto_filter, sheet.tab_color, and outline_level on
    sheet.rows(...) and sheet.columns(...) to group rows and columns.
  • DataValidation.date and DataValidation.time. Date and time rules read
    back with datetime.date and datetime.time bounds.
  • Iterating sheet.images gives PlacedImage values. sheet.images,
    sheet.charts and sheet.conditional_formats have remove(ref).
  • Table(totals_row=True) adds a table whose last row is a totals row. Its
    cells hold text, a formula or nothing; Excel rejects other values there.
  • Tables read back banded_rows; rules read back their comparison, second
    bound, blank handling, prompt, error message and style.
  • Merges, Tables, Validations, ConditionalFormats, Images,
    DefinedNames and ValidationValue are exported from crabxl.
  • crabxl.load_workbook and other names that moved to crabxl.openpyxl
    raise an ImportError that names the new location.

Fixed

  • A worksheet renamed through one handle is renamed for every handle:
    book.worksheets["Data"] gives the same object each time.

0.3.0

Choose a tag to compare

@github-actions github-actions released this 25 Nov 10:59
37b0c25

It uses the Rust core 0.3.0.

Changed

  • crabxl has its own, fully typed API. Workbook creates a workbook or
    opens one to change it; Reader and Writer stream rows with bounded
    memory. See the documentation.
  • The openpyxl interface moved to crabxl.openpyxl. Change
    import crabxl as openpyxl to import crabxl.openpyxl as openpyxl. Its
    behavior is unchanged: the openpyxl 3.1.5 suite gives the same results.

Added

  • Lossless saves: a save raises UnsupportedError instead of dropping
    content CrabXL cannot keep. Open with data_loss="allow" to permit it.
  • Row and column inserts and deletes update formulas on every sheet,
    defined names, tables, rules, merges, row heights, charts, anchors and
    internal hyperlinks.
  • Atomic saves to paths. An existing file keeps its permissions.
  • numbers="exact" returns non-integers as Decimal; integers of any size
    are exact int values.
  • Date formats read by the parts they show: datetime.date for date-only
    formats and datetime.time for time-only formats.
  • A typed exception hierarchy under CrabXLError, with sheet, cell and
    part attributes.
  • py.typed and a stub for the native module. The public package passes
    mypy and pyright in strict mode.

0.2.2

Choose a tag to compare

@github-actions github-actions released this 24 Nov 09:04
249d60f

It uses the Rust core 0.2.2.

It needs the Rust core fixes listed under Unreleased in the core changelog.

Fixed

  • Freezing panes again, or unfreezing them, left selections for panes that no
    longer exist, and Excel repaired the file.
  • merge_cells raises ValueError when the range overlaps another merged
    range. Excel removed such merges as damaged content.
  • Write-only rows could hold at most about 8,000 cells or 1 MiB of text. They
    now take all 16,384 columns, limited only by the memory budget.
  • Hyperlinks move with their cells on insert_rows, insert_cols,
    delete_rows and delete_cols.
  • Excel's _xHHHH_ escapes are decoded when reading, and literal text that
    looks like one is escaped when writing.
  • Tokenizer accepts spill references such as A1#.

Changed

  • sheet.cell() and iter_rows() with cell objects are about 35% faster.
  • Text longer than 32,767 characters raises ValueError. openpyxl cuts it
    off without a warning.

0.2.1

Choose a tag to compare

@github-actions github-actions released this 11 Nov 15:33
639ffa3

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 a ResourceLimits.
    ResourceLimits.strict() and ResourceLimits.unlimited() give the presets,
    and the CRABXL_LIMITS environment variable sets the preset for code that
    cannot pass arguments, such as pandas.
  • max_expansion_ratio stops ZIP bombs: an entry larger than 1 MiB may
    expand at most 100 times.
  • crabxl.LimitExceededError, a ValueError, says which guard a file
    exceeded and how to relax it.

Fixed

  • iter_rows with 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.value no 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 new Font or
    Alignment for 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.

0.2.0

Choose a tag to compare

@github-actions github-actions released this 11 Nov 12:15
f305022

It uses the Rust core 0.2.0.

Added

  • Workbook.save(filename, calculate=True) calculates every formula first
    and saves each result as the formula's cached value, so programs that read
    cached values, such as openpyxl with data_only=True or pandas, see
    current results. It works for new and loaded workbooks, not write-only
    ones. Array formulas are not calculated and lose their cached values.

Changed

  • Wheels are about twice as large, because they include the calculation
    engine.