/install excelize
\r \r
Description\r
\r Package excelize-py is a Python port of Go Excelize library, providing a set of functions that allow you to write and read from XLAM / XLSM / XLSX / XLTM / XLTX files. Supports reading and writing spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports complex components by high compatibility, and provided streaming API for generating or reading data from a worksheet with huge amounts of data. This library needs Python version 3.9 or later. The full API docs can be found at docs reference.\r \r
Basic Usage\r
\r
Installation\r
\r
pip install excelize\r
```\r
\r
### Create spreadsheet\r
\r
Here is a minimal example usage that will create spreadsheet file.\r
\r
```python\r
import excelize\r
\r
f = excelize.new_file()\r
try:\r
# Create a new sheet.\r
index = f.new_sheet("Sheet2")\r
# Set value of a cell.\r
f.set_cell_value("Sheet2", "A2", "Hello world.")\r
f.set_cell_value("Sheet1", "B2", 100)\r
# Set active sheet of the workbook.\r
f.set_active_sheet(index)\r
# Save spreadsheet by the given path.\r
f.save_as("Book1.xlsx")\r
except (RuntimeError, TypeError) as err:\r
print(err)\r
finally:\r
err = f.close()\r
if err:\r
print(err)\r
```\r
\r
### Reading spreadsheet\r
\r
The following constitutes the bare to read a spreadsheet document.\r
\r
```python\r
import excelize\r
\r
try:\r
f = excelize.open_file("Book1.xlsx")\r
except (RuntimeError, TypeError) as err:\r
print(err)\r
exit()\r
try:\r
# Get value from cell by given worksheet name and cell reference.\r
cell = f.get_cell_value("Sheet1", "B2")\r
print(cell)\r
# Get all the rows in the Sheet1.\r
rows = f.get_rows("Sheet1")\r
for row in rows:\r
for cell in row:\r
print(f"{cell} ", end="")\r
print()\r
except (RuntimeError, TypeError) as err:\r
print(err)\r
finally:\r
# Close the spreadsheet.\r
err = f.close()\r
if err:\r
print(err)\r
```\r
\r
### Add chart to spreadsheet file\r
\r
With Excelize chart generation and management is as easy as a few lines of code. You can build charts based on data in your worksheet or generate charts without any data in your worksheet at all.\r
\r
\x3Cp align="center">\x3Cimg width="650" src="https://github.com/xuri/excelize-py/raw/main/chart.png" alt="Excelize">\x3C/p>\r
\r
```python\r
import excelize\r
\r
f = excelize.new_file()\r
data = [\r
[None, "Apple", "Orange", "Pear"],\r
["Small", 2, 3, 3],\r
["Normal", 5, 2, 4],\r
["Large", 6, 7, 8],\r
]\r
try:\r
for idx, row in enumerate(data):\r
cell = excelize.coordinates_to_cell_name(1, idx + 1, False)\r
f.set_sheet_row("Sheet1", cell, row)\r
chart = excelize.Chart(\r
type=excelize.ChartType.Col3DClustered,\r
series=[\r
excelize.ChartSeries(\r
name="Sheet1!$A$2",\r
categories="Sheet1!$B$1:$D$1",\r
values="Sheet1!$B$2:$D$2",\r
),\r
excelize.ChartSeries(\r
name="Sheet1!$A$3",\r
categories="Sheet1!$B$1:$D$1",\r
values="Sheet1!$B$3:$D$3",\r
),\r
excelize.ChartSeries(\r
name="Sheet1!$A$4",\r
categories="Sheet1!$B$1:$D$1",\r
values="Sheet1!$B$4:$D$4",\r
),\r
],\r
title=[excelize.RichTextRun(text="Fruit 3D Clustered Column Chart")],\r
)\r
f.add_chart("Sheet1", "E1", chart)\r
# Save spreadsheet by the given path.\r
f.save_as("Book1.xlsx")\r
except (RuntimeError, TypeError) as err:\r
print(err)\r
finally:\r
err = f.close()\r
if err:\r
print(err)\r
```\r
\r
### Add picture to spreadsheet file\r
\r
```python\r
import excelize\r
\r
try:\r
f = excelize.open_file("Book1.xlsx")\r
except (RuntimeError, TypeError) as err:\r
print(err)\r
exit()\r
try:\r
# Insert a picture.\r
f.add_picture("Sheet1", "A2", "image.png", None)\r
# Insert a picture to worksheet with scaling.\r
f.add_picture("Sheet1", "D2", "image.jpg", excelize.GraphicOptions(\r
scale_x=0.5,\r
scale_y=0.5,\r
))\r
# Insert a picture offset in the cell with printing support.\r
f.add_picture("Sheet1", "H2", "image.gif", excelize.GraphicOptions(\r
print_object=True,\r
lock_aspect_ratio=False,\r
offset_x=15,\r
offset_y=10,\r
locked=False,\r
))\r
# Save the spreadsheet with the origin path.\r
f.save()\r
except (RuntimeError, TypeError) as err:\r
print(err)\r
finally:\r
# Close the spreadsheet.\r
err = f.close()\r
if err:\r
print(err)\r
```\r
\r
## References\r
\r
- Source Code: [github.com/xuri/excelize-py](https://github.com/xuri/excelize-py)\r
- Docs Repo: [github.com/xuri/excelize-py-docs](https://github.com/xuri/excelize-py-docs)\r
- PyPI: [pypi.org/project/excelize](https://pypi.org/project/excelize)\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install excelize - After installation, invoke the skill by name or use
/excelize - Provide required inputs per the skill's parameter spec and get structured output
What is Excelize?
Use when you need to reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets. It is an AI Agent Skill for Claude Code / OpenClaw, with 196 downloads so far.
How do I install Excelize?
Run "/install excelize" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Excelize free?
Yes, Excelize is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Excelize support?
Excelize is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Excelize?
It is built and maintained by xuri (@xuri); the current version is v0.0.1.