CBS Analyzer
CBS Analyzer is a financial analysis tool designed to process and analyze Chase Bank PDF statements. This project transforms raw bank statements into structured, analyzable data with powerful aggregation and export capabilities.
Table of Contents
- Installation
- Features
- Parameters
- Attributes
- Methods
- Usage Examples
- Error Handling
- Contributing
- License
Installation
pip install cbs-analyzer
Features
- Multi-Statement Processing: Analyze single statements or entire directories
- Comprehensive Financial Metrics:
- Monthly/Yearly spending trends
- Cash flow analysis
- Savings rate calculations
- Flexible Data Export: CSV, Excel, JSON, and Parquet formats
- Advanced Analysis:
- Time-based aggregation (day/month/year)
- Statistical summaries
- Custom column analysis
- Enterprise-Grade Infrastructure:
- Thread-safe processing
- Cached properties for performance
- Comprehensive error handling
Parameters
Core Parameters
file_path(PathLike): Path to PDF file or directoryascending_date(bool): Sort transactions chronologically (default: False)
Analysis Parameters
by_year/by_month/by_day(bool): Time-based groupingcolumn(str): Specific column to analyzeminimum(bool): Find minimum values instead of maximum
Attributes
transactions: Single statement transactions (DataFrame)checking_summary: Single statement summary (DataFrame)all_transactions: All statements' transactions (DataFrame)all_checking_summaries: All statements' summaries (DataFrame)
Methods
Core Methods
analyze_summaries(): Analyze checking account summariesanalyze_transactions(): Analyze transaction dataexport(): Export data to various formats
Usage Examples
Basic Analysis
from cbs_analyzer import CBSAnalyzer
# Single statement analysis
analyzer = CBSAnalyzer("path/to/statement.pdf")
print(analyzer.transactions)
# Output transactions from a single statement
# Date Description Amount Balance
# 0 2025-12-31 Card Purchase - Dd/Br.............. ............. -11.81 11940.51
# 1 2025-12-31 Card Purchase - Wendys - ........................ -12.17 11952.32
# 2 2025-12-30 Card Purchase - Walgreens ....................... -4.99 12132.78
# 3 2025-12-30 Recurring Card Purchase 12/30 ................... -29.25 11964.49
# 4 2025-12-30 Card Purchase - ................................. -31.56 11993.74
# .. ... ... ... ...
# 272 2025-01-02 Card Purchase - Dd *Doordash Wingsto Www.Doord... -10.16 11930.35
# 273 2025-01-02 Card Purchase - Walgreens .................. ... -4.43 11925.92
# 274 2025-01-02 Card Purchase - Kings ........................... -40.28 11859.62
# 275 2025-01-02 Card Purchase - Tst* ........................... -7.02 11918.90
# 276 2025-01-02 Zelle Payment To ................................ -19.00 11899.90
# Output checking summary for a single statement
print(analyzer.checking_summary)
# Output:
# Category Amount
# 0 Beginning Balance 11679.61
# 1 Deposits and Additions 2955.39
# 2 ATM & Debit Card Withdrawals -1024.11
# 3 Electronic Withdrawals -134.62
# 4 Ending Balance 13476.27
# 5 Total Withdrawals 1158.73
# 6 Net Savings 1796.66
# 7 % Saving Rate 60.79
# Directory analysis
analyzer = CBSAnalyzer("path/to/statements/")
all_data = analyzer.all_transactions
print(all_data)
# Output all transactions from multiple statements
# Date Description Amount Balance
# 0 2025-12-31 Card Purchase - Dd/Br.............. ............. -12.17 11952.32
# 1 2025-12-31 Card Purchase - Wendys - ........................ -11.81 11940.51
# 2 2025-12-30 Card Purchase - Walgreens ....................... -57.20 12066.25
# 3 2025-12-30 Recurring Card Purchase 12/30 ................... -31.56 11993.74
# 4 2025-12-30 Card Purchase - ................................. -20.80 12025.30
# ... ... ... ... ...
# 1769 2023-01-03 Card Purchase - Dd *Doordash Wingsto Www.Doord.. -4.00 1837.81
# 1770 2023-01-03 Card Purchase - Walgreens .................. ... 100.00 1765.72
# 1771 2023-01-03 Card Purchase - Kings .......................... -3.91 1841.81
# 1772 2023-01-03 Card Purchase - Tst* .......................... 70.00 1835.72
# 1773 2023-01-03 Zelle Payment To ............................... 10.00 1845.72
# ----------------------------------------------------
# Output all checking summaries from multiple statements
analyzer = CBSAnalyzer("path/to/statements/")
all_data = analyzer.all_checking_summaries
print(all_data)
# Date Beginning Balance Deposits and Additions ATM & Debit Card Withdrawals Electronic Withdrawals Ending Balance Total Withdrawals Net Savings % Saving Rate
# 0 2025-04 14767.33 2535.82 -1183.41 -513.76 15605.98 1697.17 838.65 33.07
# 1 2025-03 14319.87 4319.20 -3620.85 -250.89 14767.33 3871.74 447.46 10.36
# 2 2025-02 13476.27 2328.18 -682.24 -802.34 14319.87 1484.58 843.60 36.23
# 3 2025-01 11679.61 2955.39 -1024.11 -134.62 13476.27 1158.73 1796.66 60.79
----------------------------------------------------
Advanced Analysis
# Monthly spending analysis
monthly_spending = analyzer.analyze_transactions(
by_month=True,
column="Transactions_Count"
)
# Output:
# Month Maximum
# 0 February 205
# Annual savings rate
annual_savings = analyzer.analyze_summaries(
by_year=True,
column="% Saving Rate_Mean"
)
# Output:
# Year Maximum
# 0 2024.0 36.01
Data Export
# Export to different formats
analyzer.all_transactions.export("transactions.xlsx")
analyzer.checking_summary.export("summary.json")
analyzer.checking_summary.export(".json")
analyzer.checking_summary.export("csv")
Various cases for export_path:
- Export path is empty ("") export_path="" -> "cbsanalyzer.csv"
- Export path is a directory export_path="path/to/dir/" -> "path/to/dir/cbsanalyzer.csv"
- Export path is a file name only export_path="file" -> "file.csv"
- Export path is an extension type export_path=".csv" | "csv" -> "cbsanalyzer.csv"
- Export path is a file with a given extension export_path="file.csv" -> "file.csv"
- Export path is a hidden file name export_path="</dir/>.hidden.csv" -> "</dir/>.hidden.csv"
- Export path is the current (".") or home directory ("
") export_path="." -> "</cwdir/>/cbsanalyzer.csv" export_path="" -> "</home/>/cbsanalyzer.csv"
---
## Error Handling
The analyzer provides detailed error messages for:
- File access issues
- Malformed PDF content
- Invalid analysis parameters
Example error handling:
```python
try:
analyzer = CBSAnalyzer("invalid_path.pdf")
except FileNotFoundError as e:
print(f"Error loading statement: {e}")
Contributing
- Fork the repository
- Create a feature branch
- Submit a Pull Request
Development Setup
pip install -e ".[dev]"
pytest tests/
License
Apache 2.0 - See LICENSE for details.
CBS Analyzer © 2025
Chase is a registered trademark of JPMorgan Chase & Co.
Not affiliated with or endorsed by JPMorgan Chase & Co.
Metadata
Release files for cbs-analyzer 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cbs_analyzer-1.0.4.tar.gz | 29.2 kB | Without provenance | Details |
Release files / cbs_analyzer-1.0.4.tar.gz
| Download URL | cbs_analyzer-1.0.4.tar.gz |
|---|---|
| Size | 29.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a32a05d5b0e548dc19d551232c8e2b467c48947285a1117e76150a966ef981f0
|
|
BLAKE2b-256 checksum How to use checksums |
7a810fff2cd7d7173e27801f06840383d9bee4f41d20bc230cf7dcbf5845d6d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for cbs-analyzer 1.0.4
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.