Giter Site home page Giter Site logo

gbourniq / bank-statement-analysis Goto Github PK

View Code? Open in Web Editor NEW
46.0 4.0 16.0 1.39 MB

Flask application generating interactive visualisations from bank statements PDF documents

Dockerfile 3.59% Python 52.50% CSS 10.03% HTML 33.88%
bank-statement-documents flask-application docker computer-vision machine-learning powerbi sql-database web-application

bank-statement-analysis's Introduction

Bank Statement Analyser

Overview

This application analyses bank statements and provides analytical reports on the account expenses. This is a personal project to get an idea about my expenses and sharpen my knowledge on the following set of technologies :

  • Python Flask framework
  • Computer Vision (Google's Tesseract OCR)
  • Pdf to Image python package (Pdf2image)
  • Machine Learning (Scikit Learn) to predict transaction categories
  • Azure SQL Database to store transaction data and user login details
  • PowerBI visualisations

Behind the scenes, the app extracts transaction details from documents, predicts a category for each transaction, and upload the data to a SQL database linked to interactive PowerBI visualisations.

Demo

https://bsa-demo.azurewebsites.net/
Username : admin
Password : password123

Visualisations are generated from ~3000 transaction samples which can be viewed in transaction.db

There are three main screens to the application :

  • Transaction details
  • Dashboard views
  • Statements upload

Transaction details image

Dashboard selection screen image

Dashboard view (Total spending) image

Filtered Dashboard by Year and Category image

Read further to create your own App

Initial Setup

The following steps are required to link your own data to the displayed visualisations

  • Create a SQL Database with the tables suggested below *
  • Replace the database connection variables in parameters.py
  • In each PowerBI file (.pbix), set up a DirectQuery to the database
  • Upload .pbix files to PowerBI Service and create sharable links (Publish to Web)
  • Insert each link in the corresponding html template

* SQL Tables :

A transaction table containing transaction records

CREATE TABLE transactions (
    ID varchar(255) NOT NULL PRIMARY KEY,
    Date datetime NOT NULL,
    Value float,
    Category varchar(255),
	Reference varchar(255)
);

A users table containing login details

CREATE TABLE users (
    id INTEGER NOT NULL PRIMARY KEY Identity(1, 1),
    username VARCHAR(15) UNIQUE,
	email VARCHAR(50) UNIQUE,
	password VARCHAR(80)
);

Run the app locally

In the command prompt, run the following :

  1. Install Docker
    $ pip install docker
    
  2. Verify Docker installation
    $ docker version
    
  3. cd into the bsa-app folder
    $ cd full/path/to/bsa-app
    
  4. Build docker image
    $ docker build -t bsa_image:latest .
    
  5. Generate and Run a container
    $ docker run -p 5000:5000 bsa_image:latest
    
  6. Visit http://localhost:5000/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.