Skip to main content

🧮 Abacus(算盘)

🎯 本地 Excel 自动化框架,以中国算学文化为命名体系


📊 项目状态

指标 数值
🎯 核心能力 103 个
🧪 测试用例 1136 个(全部通过)
🔧 MCP 工具 107 个
📝 CLI 命令 100+ 个
📚 知识库文件 38 个
📈 测试覆盖率 88%

✨ 特性

  • 🏛️ 九章分类体系 - 方田、粟米、衰分、少广、商功、均输、盈不足、方程、勾股
  • 🔧 三入口 - CLI + MCP Server + Python 库
  • 🤖 AI 友好 - 完整的 SKILL.md 文档
  • 🌐 中英文支持 - i18n 国际化
  • 📝 结构化日志 - 可配置日志级别
  • 🔒 安全可靠 - 路径遍历检查、ReDoS 防护、公式注入防护

🚀 快速开始

安装

pip install abacus-excel

CLI 使用

# 查看帮助
abacus --help

# 读取数据
abacus read -f data.xlsx -s Sheet1 -r A1:D10

# 查看结构
abacus structure -f data.xlsx

# 转换格式
abacus convert-format -f data.xlsx -s Sheet1 -r A1:A100 -t number

Python 库使用

from abacus import MeasureRangeCapability, CapabilityRegistry

# 读取数据
cap = MeasureRangeCapability()
result = cap.execute(None, file="data.xlsx", sheet="Sheet1", range="A1:D10")
print(result)

MCP Server 使用

# 启动 MCP Server
python -m abacus.mcp_server

🏛️ 九章分类

章节 能力数 说明
📖 方田章 10 数据读取、单元格操作、工作表管理
🔄 粟米章 10 格式转换、数据清洗、转置、分列
📊 衰分章 4 分组、分配、汇总、分类汇总
🔢 少广章 5 数学计算、反向推导、解方程
⚙️ 商功章 25 批量操作、图表管理、格式化、筛选
📤 均输章 7 导入导出、迁移、合并
✅ 盈不足章 8 数据验证、文件验证、质量检查
📐 方程章 5 公式创建、诊断、重算、生成
📈 勾股章 12 统计分析、趋势分析、数据可视化

📁 项目结构

abacus/
├── src/abacus/           # 核心代码
│   ├── core/             # 九章能力
│   ├── cli.py            # CLI 入口
│   └── mcp_server.py     # MCP Server
├── tests/                # 测试(1136 个)
├── skills/               # SKILL.md 文档
├── docs/                 # API 文档
└── examples/             # 使用示例

📚 文档


📄 许可证

MIT License

Metadata

Release files for abacus-excel 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for abacus-excel 1.0.1
File Size Uploaded Provenance Actions
abacus_excel-1.0.1.tar.gz 287.4 kB Without provenance Details for abacus_excel-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for abacus-excel 1.0.1
File Interpreter ABI Platform Actions
abacus_excel-1.0.1-py3-none-any.whl Python 3 none any Details for abacus_excel-1.0.1-py3-none-any.whl

Total release size: 534.0 kB

Release files / abacus_excel-1.0.1.tar.gz

Download URL abacus_excel-1.0.1.tar.gz
Size 287.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2bd27902b0e89c05b04f27156b0e436bc6344992d033188f3723be223d48d05e
BLAKE2b-256 checksum
How to use checksums
7601fe8b13b2663b613221733fdd8ab99ca48490ddd45c1fa30326fcd7fc3ece
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.8

Release files / abacus_excel-1.0.1-py3-none-any.whl

Download URL abacus_excel-1.0.1-py3-none-any.whl
Size 246.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f00b15c092dfc8dd72a88ba8bd5cbb53640759d1acc8ac7f2aa9dc5a90081f7
BLAKE2b-256 checksum
How to use checksums
4739822e18b90ba16ab7a90039a87e007389187270e21f92e4d5b9a21dcba00d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.8

Security for abacus-excel 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page