xuri

Excelize

办公效率v0.0.1
作者:xuri更新于 2026-05-11excelize@clawhub_xuri/excelize
表格处理#Spreadsheets

据 AlphaMoat 统计,截至 2026-09,Excelize 累计下载 951 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 5,050 位,在「办公效率」分类(435 个)中排名第 429 位。

累计安装
131
累计下载
951
星标
-
全站排名
#5,050
全站前 100% · 「办公效率」前 99%
平台累计安装累计下载星标评论
ClawHub ↗22941--
SkillHub ↗131951-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

excelize-py 是 Go Excelize 库的 Python 移植,可处理 XLAM、XLSM、XLSX、XLTM 和 XLTX 文件,支持读取、写入及工作表流式处理。文档示例会在指定路径创建、保存或覆盖文件;操作重要工作簿前应检查目标路径,并先在副本或临时文件上运行。安装说明未固定版本,较高保证或可复现环境应在虚拟环境中安装经审查的固定版本。 需要 Python 3.9 或更高版本。

资料发布于 2026-10-29

可以用来做什么

  • 需要在 Python 程序中读取、修改或生成 Excel 工作簿的开发者。

什么时候用

  • 先核对输入与输出路径,并用副本测试;需要可复现安装时在虚拟环境中固定并审查依赖版本。

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

演示如何用 Python 读取工作表单元格,并提醒我如何避免覆盖原始文件;不要打开或修改任何文件。

月度数据趋势

累计下载951
1865971,0082026-03 · 累计下载 2432026-05 · 累计下载 4832026-06 · 累计下载 5742026-07 · 累计下载 7852026-08 · 累计下载 8502026-09 · 累计下载 95126-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-09951—-
2026-08850+8.3%-
2026-07785+36.8%-
2026-06574+18.8%-
2026-05483—-
2026-03243—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

4.9 KB · ClawHub v0.0.1
---
name: excelize
description: Use when you need to reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets.
---

## Description

Package excelize-py is a Python port of Go [Excelize](https://github.com/xuri/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](https://xuri.me/excelize-py/).

## Basic Usage
展开全部(共 169 行)
### Installation

```bash
pip install excelize
```

### Create spreadsheet

Here is a minimal example usage that will create spreadsheet file.

```python
import excelize

f = excelize.new_file()
try:
    # Create a new sheet.
    index = f.new_sheet("Sheet2")
    # Set value of a cell.
    f.set_cell_value("Sheet2", "A2", "Hello world.")
    f.set_cell_value("Sheet1", "B2", 100)
    # Set active sheet of the workbook.
    f.set_active_sheet(index)
    # Save spreadsheet by the given path.
    f.save_as("Book1.xlsx")
except (RuntimeError, TypeError) as err:
    print(err)
finally:
    err = f.close()
    if err:
        print(err)
```

### Reading spreadsheet

The following constitutes the bare to read a spreadsheet document.

```python
import excelize

try:
    f = excelize.open_file("Book1.xlsx")
except (RuntimeError, TypeError) as err:
    print(err)
    exit()
try:
    # Get value from cell by given worksheet name and cell reference.
    cell = f.get_cell_value("Sheet1", "B2")
    print(cell)
    # Get all the rows in the Sheet1.
    rows = f.get_rows("Sheet1")
    for row in rows:
        for cell in row:
            print(f"{cell}\t", end="")
        print()
except (RuntimeError, TypeError) as err:
    print(err)
finally:
    # Close the spreadsheet.
    err = f.close()
    if err:
        print(err)
```

### Add chart to spreadsheet file

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.

<p align="center"><img width="650" src="https://github.com/xuri/excelize-py/raw/main/chart.png" alt="Excelize"></p>

```python
import excelize

f = excelize.new_file()
data = [
    [None, "Apple", "Orange", "Pear"],
    ["Small", 2, 3, 3],
    ["Normal", 5, 2, 4],
    ["Large", 6, 7, 8],
]
try:
    for idx, row in enumerate(data):
        cell = excelize.coordinates_to_cell_name(1, idx + 1, False)
        f.set_sheet_row("Sheet1", cell, row)
    chart = excelize.Chart(
        type=excelize.ChartType.Col3DClustered,
        series=[
            excelize.ChartSeries(
                name="Sheet1!$A$2",
                categories="Sheet1!$B$1:$D$1",
                values="Sheet1!$B$2:$D$2",
            ),
            excelize.ChartSeries(
                name="Sheet1!$A$3",
                categories="Sheet1!$B$1:$D$1",
                values="Sheet1!$B$3:$D$3",
            ),
            excelize.ChartSeries(
                name="Sheet1!$A$4",
                categories="Sheet1!$B$1:$D$1",
                values="Sheet1!$B$4:$D$4",
            ),
        ],
        title=[excelize.RichTextRun(text="Fruit 3D Clustered Column Chart")],
    )
    f.add_chart("Sheet1", "E1", chart)
    # Save spreadsheet by the given path.
    f.save_as("Book1.xlsx")
except (RuntimeError, TypeError) as err:
    print(err)
finally:
    err = f.close()
    if err:
        print(err)
```

### Add picture to spreadsheet file

```python
import excelize

try:
    f = excelize.open_file("Book1.xlsx")
except (RuntimeError, TypeError) as err:
    print(err)
    exit()
try:
    # Insert a picture.
    f.add_picture("Sheet1", "A2", "image.png", None)
    # Insert a picture to worksheet with scaling.
    f.add_picture("Sheet1", "D2", "image.jpg", excelize.GraphicOptions(
        scale_x=0.5,
        scale_y=0.5,
    ))
    # Insert a picture offset in the cell with printing support.
    f.add_picture("Sheet1", "H2", "image.gif", excelize.GraphicOptions(
        print_object=True,
        lock_aspect_ratio=False,
        offset_x=15,
        offset_y=10,
        locked=False,
    ))
    # Save the spreadsheet with the origin path.
    f.save()
except (RuntimeError, TypeError) as err:
    print(err)
finally:
    # Close the spreadsheet.
    err = f.close()
    if err:
        print(err)
```

## References

- Source Code: [github.com/xuri/excelize-py](https://github.com/xuri/excelize-py)
- Docs Repo: [github.com/xuri/excelize-py-docs](https://github.com/xuri/excelize-py-docs)
- PyPI: [pypi.org/project/excelize](https://pypi.org/project/excelize)

「办公效率」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。