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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abacus_excel-1.0.1.tar.gz (287.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abacus_excel-1.0.1-py3-none-any.whl (246.7 kB view details)

Uploaded Python 3

File details

Details for the file abacus_excel-1.0.1.tar.gz.

File metadata

  • Download URL: abacus_excel-1.0.1.tar.gz
  • Upload date:
  • Size: 287.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.8

File hashes

Hashes for abacus_excel-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2bd27902b0e89c05b04f27156b0e436bc6344992d033188f3723be223d48d05e
MD5 c8e06d9c786a117ab4385af136ac193b
BLAKE2b-256 7601fe8b13b2663b613221733fdd8ab99ca48490ddd45c1fa30326fcd7fc3ece

See more details on using hashes here.

File details

Details for the file abacus_excel-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: abacus_excel-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 246.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.8

File hashes

Hashes for abacus_excel-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f00b15c092dfc8dd72a88ba8bd5cbb53640759d1acc8ac7f2aa9dc5a90081f7
MD5 1861927110d17806d5c9b08f0af08864
BLAKE2b-256 4739822e18b90ba16ab7a90039a87e007389187270e21f92e4d5b9a21dcba00d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

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