Skip to Content
CrabXL

openpyxl interface

Install crabxl-openpyxl and use it in place of openpyxl.

The crabxl-openpyxl package gives you the openpyxl 3.1.5 API. The Rust core reads, writes and edits the XLSX files. It is faster and uses less memory than openpyxl.

Install

pip install crabxl-openpyxl

It supports CPython 3.9 and newer. To use it with the native API, on Python 3.13 or newer, install both:

pip install "crabxl[openpyxl]"

Then crabxl.openpyxl is the same module as crabxl_openpyxl, and import crabxl.openpyxl as openpyxl also works.

Use

Import crabxl_openpyxl in place of openpyxl. The calls are the same.

import crabxl_openpyxl as openpyxl

book = openpyxl.load_workbook("input.xlsx")
book.active["A1"] = "Updated"
book.save("output.xlsx")
book.close()

This interface follows openpyxl’s behavior, also where the native crabxl API differs. For example, it moves only cells when you insert rows, it saves without content it cannot model, and text that starts with = becomes a formula. Use the native API for new code.

Next steps

The user guide is adapted from the openpyxl 3.1.5 documentation (MIT license).