The aim of the project is to forecast clients’ portfolios to determine when they can afford real estate at their desired price. Based on user input, the app examines the clients' portfolios (i.e., savings, cryptocurrency, stocks, bonds) and the down payment they are willing to pay. The app utilizes the Monte Carlo simulation to project clients’ portfolios, and it uses the future value equation to project the real estate market. These analyses will allow the application to tell the client in how many years they can afford a house at their desired price.
This project uses the standard Python 3.8 libraries and requires the following libraries and dependencies:
os
pandas
requests
streamlit
dotenv
alpaca_trade_api
datetime
dateutil.relativedelta
PIL
Monte Carlo simulation script (from MCForecastTools import MCSimulation)
The app utilizes APIs:
- Alpaca API - for pulling stocks, bonds and crypto historical prices
- Alternative - for pulling real time crypto prices
- Rapid API - Zillow - for pulling housing data
To run the application, first complete the following steps:
Option 1 - Running locally:
-
Clone the repository:
git clone https://github.com/VladislavGlupak/Real-Estate-Purchase-Planner.git
-
Create an Alpaca API and Rapid API account to obtain your own set of "keys":
-
Add your keys to the "sample.env" file:
ALPACA_API_KEY = "YOUR_KEY" ALPACA_SECRET_KEY = "YOUR_KEY" RAPIDAPI_KEY = "YOUR_KEY"
Then, change the name of the file to ".env" (the file should disappear)
-
Install Streamlit:
pip install streamlit
-
Type this code into your terminal to run the app in a web browser:
streamlit run app.py
(Make sure to run it from the folder that contains the "app.py" file!)
Any other needed dependencies are provided in the "environment.yml"
Option 2 - Running in the cloud:
-
Fork the repository from this link: GitHub
-
Add your keys to the "sample.env" file:
ALPACA_API_KEY = "YOUR_KEY" ALPACA_SECRET_KEY = "YOUR_KEY" RAPIDAPI_KEY = "YOUR_KEY"
Then, change the name of the file to ".env" (the file should disappear)
-
Create a Streamlit account
-
Go to the Streamlit Share page to connect to the app
Any other needed dependencies are provided in the "environment.yml"
-
To determine how many years it will take to afford a house or at least a down payment on your desired house price, go to the Streamlit web link via your local machine:
streamlit run app.py
-
Read the questions in the side bar on the left and enter your information
-
Review the results. You can toggle the portfolio risk level to see if a higher portfolio risk level allows you to afford the house and/or down payment on the house sooner
The Monte Carlo simulation is used to predict the approximate earnings from investments and savings. To see how this method works, please review the "MCForecastTools.py" script.
- The user answers the questions found in the left sidebar of the app:
- After that, the user has to wait until the calculation finishes
- As a result of the calculation, the user will see a message with a "Congratulations" or a "Sorry" message
- As additional information, the user will see a map and a table with the current houses offered in the desired city
On the map:
On the table:
Vladislav Glupak - GitHub
Catherine Croft - GitHub
Amanda Hum - GitHub
Magdalena Švimberská - GitHub
Thomas Brierton - GitHub
MIT