Skip to main content

Excel-declared data extraction powered by Pandas

Project description

ExcelFlow

ExcelFlow 是一个由 Excel 计划驱动的数据抽取工具。业务用户在模板中声明需要读取的 Sheet、关联方式、过滤条件、输出字段和衍生列,ExcelFlow 使用 Pandas 执行这些规则并输出 CSV、JSONL 或 Excel。

PyPI Python License: MIT

适合解决的问题

  • 从一个 Excel Sheet 中选择、重命名和转换字段。
  • 使用结构化条件筛选数据,而不需要编写代码。
  • 在同一个工作簿中关联多个 Sheet。
  • 通过安全表达式计算金额、差值和超窗天数等衍生列。
  • 按一个或多个字段分组,进行计数、求和、平均值等汇总。
  • 将同一份抽取计划保存、审核、复用和纳入版本管理。

安装

推荐使用 uv 安装为独立命令行工具:

uv tool install excelflow

也可以使用 pipx:

pipx install excelflow

详细说明参见安装指南

五分钟快速开始

生成计划模板:

excelflow template --output extraction_plan.xlsx

填写模板后,依次校验、预览和执行。假设任务ID为 order_report,源数据为 source.xlsx

excelflow validate --plan extraction_plan.xlsx
excelflow preview --plan extraction_plan.xlsx --task order_report
excelflow run --plan extraction_plan.xlsx --task order_report \
  --source source.xlsx --format csv --output output/order_report.csv

完整操作过程参见快速开始模板填写完整教程

核心能力

  • 单 Sheet 与多 Sheet 数据抽取。
  • INNER JOINLEFT JOIN、多级关联和复合关联键。
  • AND/OR 条件组及 13 种过滤运算符。
  • integerdecimalstringdatetime 输出类型。
  • 字符串、数值、日期、类型转换和 if_else 等安全逐行函数。
  • countcount_distinctsumavgconcat_agg 等分组聚合。
  • CSV、JSONL、XLSX 输出。
  • 计划校验和 Pandas 执行计划预览。

文档

示例

examples/ 提供五个递进案例:单 Sheet、过滤、关联、衍生列和分组聚合。示例计划和源数据可以直接运行。

安全边界

字段转换由受限 AST 解释器执行,不使用 Python eval()。表达式只能访问已声明的源字段、常量和受支持函数,不能执行文件操作、系统命令或任意 Python 代码。

参与项目

源码托管于 GitHub,问题和功能建议请提交到 GitHub Issues

ExcelFlow 使用 MIT License 发布。

Project details


Download files

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

Source Distribution

excelflow-0.2.0.tar.gz (149.1 kB view details)

Uploaded Source

Built Distribution

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

excelflow-0.2.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file excelflow-0.2.0.tar.gz.

File metadata

  • Download URL: excelflow-0.2.0.tar.gz
  • Upload date:
  • Size: 149.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for excelflow-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8b3ec0a346621b86033e107032ca75da084affe8eeaeaf7dc263d756ea2b9db6
MD5 b39e128e59963c156107fc24ebdbdd1c
BLAKE2b-256 24c180242250e898efd6e2d202f285193e7d7d944ea12ed452ac1cc0ac79ed14

See more details on using hashes here.

File details

Details for the file excelflow-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: excelflow-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for excelflow-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f85210062dababee197e2c7e42fa941f831f6de62adbae262dafc381eb4ae0a5
MD5 b6ddd99aaa16927cae1b226cae6abff1
BLAKE2b-256 5ff53d4ffe88c47ec8e60870fcac80ffd4d730b4853cb5c36be74328a0c0f865

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page