{"id":14065200,"url":"https://github.com/gbourniq/bank-statement-analysis","last_synced_at":"2025-03-05T23:19:44.547Z","repository":{"id":43249736,"uuid":"166582252","full_name":"gbourniq/bank-statement-analysis","owner":"gbourniq","description":"Flask application generating interactive visualisations from bank statements PDF documents","archived":false,"fork":false,"pushed_at":"2022-11-22T03:11:50.000Z","size":1425,"stargazers_count":55,"open_issues_count":7,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-04T04:33:26.696Z","etag":null,"topics":["bank-statement-documents","computer-vision","docker","flask-application","machine-learning","powerbi","sql-database","web-application"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gbourniq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-19T18:58:11.000Z","updated_at":"2024-11-23T17:03:24.000Z","dependencies_parsed_at":"2023-01-23T00:01:07.660Z","dependency_job_id":null,"html_url":"https://github.com/gbourniq/bank-statement-analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbourniq%2Fbank-statement-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbourniq%2Fbank-statement-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbourniq%2Fbank-statement-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbourniq%2Fbank-statement-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbourniq","download_url":"https://codeload.github.com/gbourniq/bank-statement-analysis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242118217,"owners_count":20074546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bank-statement-documents","computer-vision","docker","flask-application","machine-learning","powerbi","sql-database","web-application"],"created_at":"2024-08-13T07:04:21.810Z","updated_at":"2025-03-05T23:19:44.515Z","avatar_url":"https://github.com/gbourniq.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Bank Statement Analyser\r\n\r\n### Overview\r\nThis application analyses bank statements and provides analytical reports on the account expenses. \r\nThis is a personal project to get an idea about my expenses and sharpen my knowledge on the following set of technologies :\r\n- Python Flask framework\r\n- Computer Vision (Google's Tesseract OCR)\r\n- Pdf to Image python package (Pdf2image)\r\n- Machine Learning (Scikit Learn) to predict transaction categories\r\n- Azure SQL Database to store transaction data and user login details\r\n- PowerBI visualisations\r\n\r\nBehind 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.\r\n\r\n### Demo\r\nhttps://bsa-demo.azurewebsites.net/\u003cbr/\u003e\r\nUsername : admin\u003cbr/\u003e\r\nPassword : password123\r\n\u003e Visualisations are generated from ~3000 transaction samples which can be viewed in transaction.db\r\n\r\nThere are three main screens to the application : \r\n- Transaction details\r\n- Dashboard views\r\n- Statements upload\r\n\r\nTransaction details\r\n![image](resources/transaction-table.PNG)\r\n\r\nDashboard selection screen\r\n![image](resources/dashboard-selection.PNG)\r\n\r\nDashboard view (Total spending)\r\n![image](resources/total-spending-dashboard.PNG)\r\n\r\nFiltered Dashboard by Year and Category\r\n![image](resources/total-spending-filtered.png)\r\n\r\n### Read further to create your own App\r\n#### Initial Setup\r\nThe following steps are required to link your own data to the displayed visualisations\r\n- Create a SQL Database with the tables suggested below *\r\n- Replace the database connection variables in parameters.py\r\n- In each PowerBI file (.pbix), set up a DirectQuery to the database\r\n- Upload .pbix files to PowerBI Service and create sharable links (Publish to Web)\r\n- Insert each link in the corresponding html template\r\n\r\n#### * SQL Tables :\r\n\r\n\u003e A transaction table containing transaction records\r\n\r\n```\r\nCREATE TABLE transactions (\r\n    ID varchar(255) NOT NULL PRIMARY KEY,\r\n    Date datetime NOT NULL,\r\n    Value float,\r\n    Category varchar(255),\r\n\tReference varchar(255)\r\n);\r\n```\r\n \r\n\u003e A users table containing login details\r\n\r\n```\r\nCREATE TABLE users (\r\n    id INTEGER NOT NULL PRIMARY KEY Identity(1, 1),\r\n    username VARCHAR(15) UNIQUE,\r\n\temail VARCHAR(50) UNIQUE,\r\n\tpassword VARCHAR(80)\r\n);\r\n```\r\n#### Run the app locally\r\nIn the command prompt, run the following :\r\n1.\tInstall Docker\r\n    ```\r\n    $ pip install docker\r\n    ```\r\n2.  Verify Docker installation\r\n    ```\r\n    $ docker version\r\n    ```\r\n3.  cd into the bsa-app folder\r\n    ```\r\n    $ cd full/path/to/bsa-app\r\n    ```\r\n4.\tBuild docker image\r\n    ```\r\n    $ docker build -t bsa_image:latest .\r\n    ```\r\n5.\tGenerate and Run a container\r\n    ```\r\n    $ docker run -p 5000:5000 bsa_image:latest\r\n    ```\r\n6.\tVisit http://localhost:5000/\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbourniq%2Fbank-statement-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbourniq%2Fbank-statement-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbourniq%2Fbank-statement-analysis/lists"}