The Statement Processor (stmt) is a command-line tool that processes Bank of America and Chase transaction CSV files and reformats them into a specific format suitable for use in a Google Sheets-based Budget App. This tool simplifies the process of converting the raw transaction data from these banks into a clean and structured format, making it easier to import and analyze the data in your Budget App.
- Identifies the bank name based on the column headers of the transaction file
- Removes unnecessary columns such as "Reference Number" and "Address" (Bank of America) or "Memo", "Post Date", and "Type" (Chase)
- Splits the "Amount" column into separate "Credit" and "Debit" columns
- Cleans up empty values and ensures that zeros do not appear in the "Credit" and "Debit" columns
- Sorts the transactions in ascending order based on the "Date" column
- Generates an output CSV file with the processed data in the desired format
- Option to unite multiple transaction sheets into one after processing
Before installing and using the Statement Processor, ensure that you have the following:
- Python 3.8 or higher installed on your system. You can check your Python version with:
python3 --version
- Poetry package manager installed. You can install it using:
curl -sSL https://install.python-poetry.org | python3 - - pipx installed for managing Python CLI tools. You can install it using:
python3 -m pip install --user pipx python3 -m pipx ensurepath
To install the Statement Processor, follow these steps:
-
Clone the Repository:
Clone the
stmtrepository from GitHub and navigate to the project directory:git clone https://github.com/andreisuslov/stmt.git cd stmt -
Install Dependencies and the Command-Line Tool:
Use the provided
Makefileto install the dependencies and thestmtcommand-line tool:make install
This command will:
- Check if
pipxis installed. - Configure the project environment using Poetry.
- Install the
stmtcommand-line tool into the default pipx-managed directory (typically~/.local/bin).
- Check if
-
Add
stmtto the PATH:If
stmtis not immediately recognized as a command, ensure that the pipx binary directory (~/.local/bin) is included in your system's PATH.Add the following line to your shell configuration file (e.g.,
~/.zshrcor~/.bashrc):export PATH=$HOME/.local/bin:$PATH
Reload the shell configuration:
source ~/.zshrc # Or ~/.bashrc for bash users
-
Verify the Installation:
After installation, verify that the
stmtcommand is available by running:stmt --help
If the installation was successful, you will see the help message for the
stmtcommand-line tool.
Once the installation is complete, you can use the stmt command to process your Bank of America or Chase transaction CSV files:
stmt /path/to/your/transactions.csvReplace /path/to/your/transactions.csv with the actual path to your Bank of America or Chase transaction CSV file.
To unite multiple transaction sheets into one, use the --unite option:
stmt --unite /path/to/your/transactions1.csv /path/to/your/transactions2.csvThe processed transactions will be saved in a new CSV file located in the same directory as the input file(s). The output file will have a generated name based on the bank name, account type, timestamp, and a unique identifier.
To uninstall the Statement Processor, run the following command:
pipx uninstall stmtContributions to the Statement Processor are welcome!