finance-manager
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFinance Manager
财务管理工具包
A comprehensive toolkit for personal finance management that processes transaction data, performs sophisticated financial analysis, generates actionable insights, and creates beautiful visual reports.
一款用于个人财务管理的综合工具包,可处理交易数据、执行专业财务分析、生成可执行洞察并创建美观的可视化报告。
Core Capabilities
核心功能
- Transaction Data Processing: Extract financial data from PDFs, CSVs, or JSON files
- Financial Analysis: Calculate key metrics, identify spending patterns, and track savings
- Visualization: Generate interactive HTML reports with charts and graphs
- Budget Recommendations: Provide personalized, actionable advice based on spending patterns
- Trend Analysis: Identify spending patterns, anomalies, and opportunities for optimization
- 交易数据处理:从PDF、CSV或JSON文件中提取财务数据
- 财务分析:计算关键指标、识别消费模式并追踪储蓄情况
- 可视化:生成包含图表的交互式HTML报告
- 预算建议:基于消费模式提供个性化、可执行的建议
- 趋势分析:识别消费模式、异常情况及优化机会
Workflow
工作流程
1. Data Extraction and Preparation
1. 数据提取与准备
For PDF files:
bash
python scripts/extract_pdf_data.py <input.pdf> <output.csv>For CSV/JSON files:
- Ensure data has columns: ,
Date,Description(category),Income,TypeAmount - Date format: YYYY-MM-DD or parseable date string
- Amount: Positive for income, negative for expenses
针对PDF文件:
bash
python scripts/extract_pdf_data.py <input.pdf> <output.csv>针对CSV/JSON文件:
- 确保数据包含以下列:、
Date、Description(类别)、Income、TypeAmount - 日期格式:YYYY-MM-DD或可解析的日期字符串
- 金额:收入为正,支出为负
2. Financial Analysis
2. 财务分析
Run comprehensive analysis on transaction data:
bash
python scripts/analyze_finances.py <transactions.csv> > analysis_output.jsonOutput includes:
- Summary statistics (total income, expenses, net savings, savings rate)
- Spending trends (daily averages, top expenses, category percentages)
- Budget recommendations (personalized based on spending patterns)
- Visualization data (prepared for charting)
对交易数据进行全面分析:
bash
python scripts/analyze_finances.py <transactions.csv> > analysis_output.json输出内容包括:
- 汇总统计(总收入、总支出、净储蓄、储蓄率)
- 消费趋势(日均支出、Top5大额支出、类别占比)
- 预算建议(基于消费模式的个性化建议)
- 可视化数据(为图表生成准备的数据)
3. Report Generation
3. 报告生成
Create interactive HTML report with visualizations:
bash
python scripts/generate_report.py <analysis_output.json> <report.html>Report features:
- Summary dashboard with key metrics
- Interactive pie chart showing spending by category
- Bar chart comparing income vs expenses over time
- Color-coded indicators (green for positive, red for negative)
- Personalized recommendations section
- Responsive design for all devices
创建带可视化内容的交互式HTML报告:
bash
python scripts/generate_report.py <analysis_output.json> <report.html>报告特性:
- 包含关键指标的汇总仪表盘
- 展示类别支出占比的交互式饼图
- 对比收入与支出随时间变化的柱状图
- 颜色编码标识(绿色代表正向,红色代表负向)
- 个性化建议板块
- 适配所有设备的响应式设计
4. Complete Workflow Example
4. 完整工作流程示例
bash
undefinedbash
undefinedExtract data from PDF
从PDF中提取数据
python scripts/extract_pdf_data.py finance_data.pdf transactions.csv
python scripts/extract_pdf_data.py finance_data.pdf transactions.csv
Analyze the data
分析数据
python scripts/analyze_finances.py transactions.csv > analysis.json
python scripts/analyze_finances.py transactions.csv > analysis.json
Generate visual report
生成可视化报告
python scripts/generate_report.py analysis.json financial_report.html
undefinedpython scripts/generate_report.py analysis.json financial_report.html
undefinedKey Metrics and Benchmarks
关键指标与参考基准
Savings Rate
储蓄率
Savings Rate = (Total Income - Total Expenses) / Total Income × 100Benchmarks:
- Below 10%: Needs improvement
- 10-20%: Good
- 20-30%: Excellent
- Above 30%: Outstanding
储蓄率 = (总收入 - 总支出) / 总收入 × 100参考基准:
- 低于10%:需要改进
- 10-20%:良好
- 20-30%:优秀
- 高于30%:卓越
Category Guidelines (% of income)
类别支出指南(占收入的百分比)
- Housing: 25-30%
- Transportation: 10-15%
- Food: 10-15%
- Utilities: 5-10%
- Savings: Minimum 20%
For detailed frameworks and methodologies, see .
references/financial_frameworks.md- 住房:25-30%
- 交通:10-15%
- 餐饮:10-15%
- 公用事业:5-10%
- 储蓄:最低20%
如需详细框架与方法,请查看。
references/financial_frameworks.mdAnalysis Features
分析功能
Summary Statistics
汇总统计
- Total income and expenses for the period
- Net savings (can be positive or negative)
- Savings rate percentage
- Transaction count
- Date range covered
- 统计周期内的总收入与总支出
- 净储蓄(可正可负)
- 储蓄率百分比
- 交易笔数
- 覆盖的日期范围
Spending Trends
消费趋势
- Daily average spending
- Top 5 largest expenses with details
- Category percentage breakdown
- Spending patterns over time
- 日均支出
- 带详情的Top5大额支出
- 类别支出占比明细
- 随时间变化的消费模式
Budget Recommendations
预算建议
The system generates personalized recommendations based on:
- Savings rate thresholds
- Category spending percentages
- Income diversification
- Budget guideline comparisons
Example recommendations:
- "⚠️ Your savings rate is below 10%. Consider reducing discretionary spending."
- "🍽️ Food spending is 18% of expenses. Consider meal planning to reduce costs."
- "✅ Excellent savings rate! You're on track for strong financial health."
系统会基于以下内容生成个性化建议:
- 储蓄率阈值
- 类别支出占比
- 收入多元化情况
- 与预算指南的对比
建议示例:
- "⚠️ 你的储蓄率低于10%。考虑减少非必要支出。"
- "🍽️ 餐饮支出占比18%。考虑通过规划用餐来降低成本。"
- "✅ 储蓄率优秀!你的财务状况处于良好轨道。"
Visualization Components
可视化组件
Category Spending Chart (Doughnut)
类别支出环形图
Shows proportional breakdown of expenses by category with color coding.
通过颜色编码展示各支出类别的占比情况。
Income vs Expenses Chart (Bar)
收入与支出柱状图
Displays monthly comparison of income and expenses to identify cash flow trends.
展示月度收入与支出对比,识别现金流趋势。
Interactive Features
交互特性
- Hover tooltips showing exact values
- Responsive design adapting to screen size
- Color-coded positive (green) and negative (red) indicators
- 悬浮提示显示精确数值
- 适配屏幕尺寸的响应式设计
- 颜色编码标识正向(绿色)与负向(红色)数据
Tips for Best Results
最佳实践建议
Data Quality
数据质量
- Ensure all transactions are properly categorized
- Use consistent category names
- Include complete date information
- Verify amounts are correctly signed (+ for income, - for expenses)
- 确保所有交易都已正确分类
- 使用统一的类别名称
- 包含完整的日期信息
- 确认金额符号正确(收入为+,支出为-)
Analysis Frequency
分析频率
- Run monthly analysis for trend tracking
- Generate reports at month-end for review
- Compare month-over-month to identify changes
- 每月运行分析以追踪趋势
- 在月末生成报告用于复盘
- 对比月度数据以识别变化
Action on Recommendations
建议落地
- Prioritize recommendations by potential impact
- Set specific, measurable goals based on insights
- Track progress by re-running analysis regularly
- 优先处理影响最大的建议
- 基于洞察设定具体、可衡量的目标
- 通过定期重新运行分析来追踪进度
Dependencies
依赖项
All scripts require Python 3.7+ with standard libraries. Additional requirements:
For PDF extraction:
bash
pip install pdfplumber --break-system-packagesFor data analysis:
bash
pip install pandas --break-system-packagesAll visualization dependencies are loaded from CDN in the HTML output (Chart.js).
所有脚本需要Python 3.7+及标准库。额外依赖项:
针对PDF提取:
bash
pip install pdfplumber --break-system-packages针对数据分析:
bash
pip install pandas --break-system-packages所有可视化依赖项通过HTML输出中的CDN加载(Chart.js)。
File Organization
文件组织结构
finance-manager/
├── scripts/
│ ├── extract_pdf_data.py # PDF → CSV conversion
│ ├── analyze_finances.py # Financial analysis engine
│ └── generate_report.py # HTML report generator
└── references/
└── financial_frameworks.md # Detailed analysis methodologiesfinance-manager/
├── scripts/
│ ├── extract_pdf_data.py # PDF转CSV格式转换
│ ├── analyze_finances.py # 财务分析引擎
│ └── generate_report.py # HTML报告生成器
└── references/
└── financial_frameworks.md # 详细分析方法Customization
自定义配置
Adding Custom Categories
添加自定义类别
Edit the category definitions in to match your tracking system.
analyze_finances.py编辑中的类别定义以匹配你的追踪系统。
analyze_finances.pyAdjusting Thresholds
调整阈值
Modify recommendation thresholds in the function to match personal goals.
generate_budget_recommendations()修改函数中的建议阈值以匹配个人目标。
generate_budget_recommendations()Styling Reports
报告样式定制
Customize the HTML_TEMPLATE in to adjust colors, fonts, or layout.
generate_report.py修改中的HTML_TEMPLATE以调整颜色、字体或布局。
generate_report.pyCommon Use Cases
常见使用场景
Monthly Review:
"Analyze my October spending and create a report"
Budget Optimization:
"Where am I spending too much money?"
"Where am I spending too much money?"
Trend Analysis:
"How does my spending this month compare to last month?"
Goal Setting:
"What's my savings rate and how can I improve it?"
Category Insights:
"Break down my food spending by transaction"
PDF Processing:
"Extract all transactions from my bank statement PDF"
月度复盘:
"分析我10月份的支出并生成报告"
预算优化:
"我在哪里花了太多钱?"
"我在哪里花了太多钱?"
趋势分析:
"我这个月的支出和上个月相比有什么变化?"
目标设定:
"我的储蓄率是多少,如何提升?"
类别洞察:
"拆分我的餐饮支出交易明细"
PDF处理:
"从我的银行对账单PDF中提取所有交易记录"
Best Practices
最佳实践
- Consistent Categorization: Use the same category names across all transactions
- Regular Analysis: Run monthly to spot trends early
- Act on Insights: Use recommendations to make specific spending changes
- Track Progress: Compare reports month-over-month
- Verify Data: Always check extracted PDF data for accuracy before analysis
- 统一分类:所有交易使用相同的类别名称
- 定期分析:每月运行分析以尽早发现趋势
- 落地洞察:利用建议做出具体的支出调整
- 追踪进度:对比月度报告
- 验证数据:在分析前始终检查提取的PDF数据准确性
Reference Materials
参考资料
For comprehensive financial frameworks, budgeting guidelines, and analysis methodologies, read:
bash
view references/financial_frameworks.mdThis includes:
- The 50/30/20 budget rule
- Category spending benchmarks
- Financial health indicators
- Analysis workflow details
- Visualization best practices
- Recommendation logic
如需全面的财务框架、预算指南与分析方法,请查看:
bash
view references/financial_frameworks.md其中包括:
- 50/30/20预算法则
- 类别支出参考基准
- 财务健康指标
- 分析工作流程细节
- 可视化最佳实践
- 建议逻辑