Skip to content

ru0ya/mpesaView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

M-Pesa Analyzer Pro 📊

A production-ready Streamlit application for analyzing M-Pesa statements (PDF and CSV) with AI-powered financial insights using Google Gemini.

Features

  • Multi-Format Support: Upload standard M-Pesa PDF or CSV statements.
  • Interactive Dashboard:
    • Financial Overview (Income, Expenses, Savings).
    • Monthly Trends.
    • Category Breakdown (Airtime, Pay Bill, etc.).
    • Daily Activity Heatmaps.
  • Transaction Explorer: Searchable and filterable transaction history.
  • AI Financial Advisor: Get personalized spending summaries and recommendations powered by Google Gemini.
  • Privacy First: Data is processed locally in memory. Only summarized statistics are sent to the AI (and only when you request it).

Installation

Prerequisites

  • Python 3.10+
  • A Google Gemini API Key (Get one here)

Setup

  1. Clone the repository

    git clone <your-repo-url>
    cd pesaView
  2. Create a virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configuration Copy .env.example to .env and add your API key:

    cp .env.example .env

    Edit .env:

    GEMINI_API_KEY=your_actual_api_key_here
    

Usage

Run the Streamlit app:

streamlit run app.py

The application will open in your browser at http://localhost:8501.

M-Pesa Statement Formats

CSV

Supported columns (auto-detected):

  • Receipt No.
  • Completion Time
  • Details
  • Paid In
  • Withdrawn
  • Balance

PDF

The parser supports standard personal M-Pesa statements generated from the mySafaricom App or USSD *234#.

Development

Run unit tests:

pytest

Technologies

  • Streamlit: Web UI
  • Pandas: Data processing
  • Plotly: Interactive visualizations
  • pdfplumber: PDF extraction
  • Google Generative AI: Financial insights

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors