一款轻量级、易用的财务/数据分析辅助工具,帮助用户快速从大量数字中找出符合特定和值的组合。
- Excel 文件导入 - 支持拖拽或浏览导入 .xlsx/.xls 文件
- 直接粘贴数字 - 支持从剪贴板直接粘贴数字
- 灵活参数设置 - 可设置目标和、容差、组合数量
- 快速查找 - 采用回溯+剪枝算法,快速定位结果
- 结果一键复制 - 查找结果可直接复制到剪贴板
- macOS 风格界面 - 简洁美观,操作直观
┌─────────────────────────────────────────────────────────────────────────┐
│ SumFinder Pro ─ □ × │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ 数据输入 │ │
│ │ 📄 导入文件 [浏览...] 或 📋 粘贴数字 │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ 查找参数 │ │
│ │ 🎯 目标和 [ ] 📏 容差 [ 0.01 ] │ │
│ │ [━━━━━━━━━━ 开始查找 ━━━━━━━━━━] │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ 查找结果 │ │
│ │ ▸ 组合 #1: 281.64 + 150.00 + 98.50 + 33.14 = 563.28 │ │
│ └───────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
# 1. 克隆项目
git clone https://github.com/yourusername/sumfinder-pro.git
cd sumfinder-pro
# 2. 安装依赖
pip install -r requirements.txt
# 3. 运行
python main.py下载 dist/SumFinderPro.exe,双击运行即可。
- 点击"浏览"按钮选择 Excel 文件,或直接拖拽文件到窗口
- 从下拉列表中选择要查找的列
- 查看预览数据,确认有效数字数量
- 将数字复制到剪贴板
- 粘贴到"粘贴数字"输入框
- 支持多种分隔格式:换行、空格、逗号
- 输入目标和 - 你想找到的和值
- 设置容差 - 允许的误差范围(默认 0.01)
- 设置组合数量 - 要找几个不同的组合(默认 1)
- 点击"开始查找"
# 换行分隔
24.81
24.81
25.47
# 空格分隔
24.81 24.81 25.47
# 逗号分隔
24.81, 24.81, 25.47
# 混合格式
24.81
24.81, 25.47 31.67
sumfinder-pro/
├── main.py # 应用入口
├── ui/
│ ├── main_window.py # 主窗口
│ ├── styles/ # 样式管理
│ └── widgets/ # UI 组件
│ ├── input_panel.py # 数据输入面板
│ ├── param_panel.py # 参数设置面板
│ └── result_panel.py # 结果展示面板
├── core/
│ ├── algorithm.py # 查找算法
│ ├── excel_processor.py # Excel 处理
│ └── text_parser.py # 文本解析
├── resources/
│ └── styles/ # QSS 样式表
├── requirements.txt # 依赖列表
└── README.md # 说明文档
- Python 3.8+
- PySide6 - Qt GUI 框架
- pandas - 数据处理
- openpyxl - Excel 文件读写
# 安装 PyInstaller
pip install pyinstaller
# 打包成单个 exe
pyinstaller --onefile --windowed --name "SumFinderPro" main.py
# 打包完成后,exe 文件位于 dist/SumFinderPro.exe# 使用 ruff 进行代码检查和格式化
pip install ruff
ruff check .
ruff format .采用回溯+剪枝算法:
- 数字按绝对值降序排序,优先尝试大数便于剪枝
- 使用前缀和预计算,快速判断剩余数能否达到目标
- 三种剪枝策略:
- 当前和超过目标 → 剪枝
- 剩余数不足以达到目标 → 剪枝
- 跳过重复数字 → 避免重复搜索
MIT License
- 初始版本发布
- 支持 Excel 导入和直接粘贴
- macOS 风格界面
- 多组合查找功能
A lightweight and user-friendly financial/data analysis tool that helps users quickly find number combinations that sum to a specific target value.
- Excel Import - Drag & drop or browse to import .xlsx/.xls files
- Direct Paste - Paste numbers directly from clipboard
- Flexible Parameters - Set target sum, tolerance, and combination count
- Fast Search - Backtracking with pruning algorithm for quick results
- One-Click Copy - Copy search results directly to clipboard
- macOS-Style UI - Clean, beautiful, and intuitive interface
# 1. Clone the project
git clone https://github.com/yourusername/sumfinder-pro.git
cd sumfinder-pro
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run
python main.pyDownload dist/SumFinderPro.exe and double-click to run.
- Click "Browse" to select an Excel file, or drag & drop the file
- Select the column to search from the dropdown
- Preview the data and confirm the valid number count
- Copy numbers to clipboard
- Paste into the "Paste Numbers" input box
- Supports multiple delimiters: newline, space, comma
- Enter Target Sum - The sum value you want to find
- Set Tolerance - Allowed error range (default 0.01)
- Set Combination Count - Number of different combinations to find (default 1)
- Click "Start Search"
# Newline separated
24.81
24.81
25.47
# Space separated
24.81 24.81 25.47
# Comma separated
24.81, 24.81, 25.47
# Mixed format
24.81
24.81, 25.47 31.67
sumfinder-pro/
├── main.py # Application entry point
├── ui/
│ ├── main_window.py # Main window
│ ├── styles/ # Style management
│ └── widgets/ # UI components
├── core/
│ ├── algorithm.py # Search algorithm
│ ├── excel_processor.py # Excel processing
│ └── text_parser.py # Text parsing
├── resources/
│ └── styles/ # QSS stylesheets
├── requirements.txt # Dependencies
└── README.md # Documentation
- Python 3.8+
- PySide6 - Qt GUI framework
- pandas - Data processing
- openpyxl - Excel file I/O
# Install PyInstaller
pip install pyinstaller
# Package as single exe
pyinstaller --onefile --windowed --name "SumFinderPro" main.py
# The exe file will be at dist/SumFinderPro.exe# Use ruff for linting and formatting
pip install ruff
ruff check .
ruff format .Uses backtracking with pruning:
- Sort numbers by absolute value in descending order for efficient pruning
- Pre-compute prefix sums for quick remaining sum checks
- Three pruning strategies:
- Current sum exceeds target → prune
- Remaining numbers insufficient → prune
- Skip duplicate numbers → avoid duplicate searches
MIT License
- Initial release
- Excel import and direct paste support
- macOS-style UI
- Multi-combination search