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
18659710082026-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),按月更新。口徑說明見資料方法。