How keetasin/us-utilities-forecast works
This is a Flask stock-analysis and forecasting application for five US utilities. Users browse stock prices and financial indicators, read recent company news, and request forecasts or compare ARIMA, SARIMA, SARIMAX, and LSTM results with backtest accuracy. The web layer reads and writes persisted application records; scheduled jobs refresh stock and news data. The README also documents an Airflow/Spark data-refresh path, but the sampled DAG excerpt does not show its task wiring, so that connection is left out. Forecast internals and several dashboard routes are only partially sampled.
Main entry points: views.py Web views · models.py Data models · forecast.py Forecast engine · stock.py Stock data
Components 14
Forecasting
- Forecast engine
src/web/utils/forecast.py
Data refresh
- Stock data
src/web/utils/stock.py - News fetch
src/web/utils/news.py - Job scheduler
src/web/scheduler.py - Forecast DAG
src/dags/forecast-stock.py - Market ingestion
src/spark/applications/spark_jobs/pull_yf.py
Persisted data
- Data models
src/web/models.py - PostgreSQL
- Parquet output
Other components
- Investor
- Yahoo Finance
- NewsAPI
Connections 18
- Investor → Flask app: uses
- Flask app → Web views: registers routes
- Web views → Data models: queries
- Web views → Forecast engine: requests forecasts
- Web views → Yahoo Finance: fetches analytics
- Web views → Investor: renders views
- Data models → PostgreSQL: reads and writes
- Job scheduler → Stock data: schedules refresh
- Job scheduler → News fetch: schedules refresh
- Stock data → Yahoo Finance: fetches prices
- Stock data → Data models: updates stock records
- News fetch → NewsAPI: fetches articles
- News fetch → Data models: updates news records
- Forecast engine → Yahoo Finance: fetches price history
- Forecast engine → Data models: stores forecasts
- Forecast DAG → Market ingestion
- Market ingestion → Yahoo Finance: downloads market data
- Market ingestion → Parquet output: writes parquet