Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gbourniq/bank-statement-analysis
Flask application generating interactive visualisations from bank statements PDF documents
https://github.com/gbourniq/bank-statement-analysis
bank-statement-documents computer-vision docker flask-application machine-learning powerbi sql-database web-application
Last synced: 3 months ago
JSON representation
Flask application generating interactive visualisations from bank statements PDF documents
- Host: GitHub
- URL: https://github.com/gbourniq/bank-statement-analysis
- Owner: gbourniq
- Created: 2019-01-19T18:58:11.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-11-22T03:11:50.000Z (almost 2 years ago)
- Last Synced: 2024-05-28T04:09:29.336Z (6 months ago)
- Topics: bank-statement-documents, computer-vision, docker, flask-application, machine-learning, powerbi, sql-database, web-application
- Language: Python
- Homepage:
- Size: 1.36 MB
- Stars: 46
- Watchers: 4
- Forks: 16
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - gbourniq/bank-statement-analysis - Flask application generating interactive visualisations from bank statements PDF documents (Python)
README
# 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 visualisationsBehind 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.dbThere are three main screens to the application :
- Transaction details
- Dashboard views
- Statements uploadTransaction details
![image](resources/transaction-table.PNG)Dashboard selection screen
![image](resources/dashboard-selection.PNG)Dashboard view (Total spending)
![image](resources/total-spending-dashboard.PNG)Filtered Dashboard by Year and Category
![image](resources/total-spending-filtered.png)### 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/