Configs2026年5月28日·1 分钟阅读

Excelize — High-Performance Go Library for Excel Spreadsheets

Excelize is a Go library for reading, writing, and manipulating Microsoft Excel files (XLSX/XLSM/XLTM). It supports formulas, charts, pivot tables, images, conditional formatting, and streaming writes for large datasets.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Excelize Excel Library
直接安装命令
npx -y tokrepo@latest install 3188eebe-5ad3-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Excelize provides a pure Go implementation for reading and writing Office Open XML spreadsheet files. It lets backend services generate complex Excel reports, import user-uploaded spreadsheets, and process large datasets without relying on external binaries or COM automation.

What Excelize Does

  • Reads and writes XLSX, XLSM, and XLTM files with full formula support
  • Creates charts (bar, line, pie, scatter, and 50+ chart types)
  • Generates pivot tables and applies conditional formatting rules
  • Embeds images, shapes, and comments into cells
  • Streams rows for writing spreadsheets with millions of rows in constant memory

Architecture Overview

Excelize operates on the underlying ZIP-packaged XML structure of Office Open XML files. It parses shared strings, style sheets, and worksheet XML into in-memory Go structs, applies edits, then serializes back to valid OOXML. The streaming writer bypasses full in-memory representation by flushing rows directly to the output, enabling constant-memory writes for large files.

Self-Hosting & Configuration

  • Install via go get github.com/xuri/excelize/v2
  • Zero external dependencies beyond the Go standard library
  • Use StreamWriter for files exceeding available RAM
  • Set default fonts, number formats, and date styles via Style structs
  • Supports password-protected workbook decryption

Key Features

  • Pure Go with no CGO or system dependencies
  • Streaming writer handles millions of rows in constant memory
  • 170+ formula functions evaluated natively
  • 50+ chart types with full customization
  • Thread-safe concurrent read access to workbooks

Comparison with Similar Tools

  • Apache POI (Java) — mature but requires JVM; Excelize is a single Go binary
  • openpyxl (Python) — Python-only; Excelize integrates into Go services natively
  • SheetJS (JS) — browser-focused; Excelize targets server-side batch processing
  • xlsx2csv — read-only conversion; Excelize supports full read-write-chart workflows
  • Google Sheets API — cloud-dependent; Excelize works fully offline

FAQ

Q: Can Excelize handle very large files? A: Yes, the StreamWriter API writes rows incrementally, keeping memory constant regardless of row count.

Q: Does it support formulas? A: Excelize supports setting formula strings and evaluating 170+ built-in functions.

Q: Is Excelize thread-safe? A: Concurrent reads are safe. Writes to a single file should be serialized.

Q: Can I read password-protected Excel files? A: Yes, Excelize supports decrypting workbooks protected with a password.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产