Skip to content
Automated Financial Advisor
Automated Financial Advisor
This project is a Flask-based web application that integrates with QuickBooks Online to fetch financial data, generate insights using OpenAI's API, and produce a PDF report. The application allows users to select specific financial reports and receive detailed insights and recommendations based on the fetched data.
Features
- QuickBooks Integration: Fetch financial reports including Accounts Payable Aging Summary, Accounts Receivable Aging Summary, Balance Sheet, Statement of Cash Flows, and Profit and Loss.
- OpenAI Integration: Generate detailed insights and recommendations by analyzing the financial data using OpenAI's API.
- PDF Report Generation: Automatically generate a PDF report containing the insights and recommendations.
- User-Friendly Interface: Simple and intuitive web interface for selecting desired financial reports and generating the final report.
Requirements
- Python 3.8+
- Flask
- Requests
- OpenAI Python Client
- FPDF
- QuickBooks Client SDK (qbClient)
Installation
- Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install dependencies:
pip install -r requirements.txt
- Set up your environment:
- Obtain your OpenAI API key from OpenAI.
- Set up your QuickBooks API credentials and ensure they are correctly configured in constants.py.
- Run the application:
python app.py
- Access the application:
- Open your web browser and go to
http://127.0.0.1:5000/to use the application.
Configuration
Ensure that you have correctly set up your constants.py file with the necessary credentials for QuickBooks and OpenAI.
# constants.py client_secrets = { "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET", "redirect_uri": "YOUR_REDIRECT_URI", # other required details } qBData = { "realm_id": "YOUR_REALM_ID" } refreshToken = "YOUR_REFRESH_TOKEN"
Usage
- Select Reports: Choose the financial reports you want to analyze by selecting the appropriate checkboxes.
- Generate Report: Click the "Submit" button to fetch the data, generate insights, and produce a PDF report.
- Download Report: Once the report is generated, it will be saved as financial_report.pdf in the root directory.
Contributing
All contributions are welcome!
Acknowledgements
- QuickBooks API
- OpenAI API
- Flask
- FPDF
