A Bash-based command line tool for parsing and summarizing M-Pesa mobile money statements.
# M-Pesa CLI Parser
A lightweight Bash-based command line utility for parsing and summarizing M-Pesa mobile money CSV statements. Designed for quick financial analysis and transaction filtering.
## Features
- Summarize total income and expenditure.
- Calculate net cash flow.
- Filter transactions by keywords (e.g., specific paybills or names).
- Cleanly formatted table output.
## Requirements
- Bash 4.x or higher
- `awk` (standard on most Unix systems)
## Installation
1. Clone or download this project.
2. Give execution permissions to the script:
```bash
chmod +x parser.sh
```
## Usage
Run the script against a valid M-Pesa CSV export file.
```bash
# Show all transactions and summary
./parser.sh -f statement.csv
# Filter for specific transactions (e.g., Safaricom or Electricity)
./parser.sh -f statement.csv -s "Safaricom"
# View output without the footer summary
./parser.sh -f statement.csv -n
```
## CSV Format
The tool expects the standard M-Pesa export format containing:
`Receipt No, Completion Time, Details, Transaction Status, Paid In, Withdrawn, Balance`