Financial Analytics · ESG Risk · Sustainability Rating
A modular Python fintech analytics platform that evaluates companies using ESG metrics and financial risk indicators.
The Real-Time ESG Investment Analyzer is a financial analytics platform that combines Environmental, Social, and Governance (ESG) scoring with traditional financial risk analysis.
The system fetches live market data, computes sustainability metrics, evaluates financial volatility, and produces an Investment Sustainability Rating (ISR).
The platform exposes:
- a REST API built with FastAPI
- an interactive analytics dashboard built with Streamlit
- a CLI reporting tool for terminal-based analysis
This project demonstrates how ESG indicators can be integrated with quantitative financial analysis.
| Category | Capability |
|---|---|
| Market Data | Real-time price quotes and 1-year price history via Yahoo Finance |
| ESG Scoring | Environmental, Social, and Governance sub-scores |
| Risk Analysis | Annualized volatility and three-tier risk classification |
| Investment Rating | Combined ESG + financial risk sustainability score |
| REST API | FastAPI service with OpenAPI documentation |
| Dashboard | Interactive Streamlit analytics dashboard |
| CLI Tool | Terminal-based investment report |
| Comparison Tool | Multi-company ESG comparison with radar charts |
User Input (Ticker)
│
▼
FastAPI API Layer
(main.py)
│
▼
Core Analytics Pipeline
├── market_data.py
├── risk_analysis.py
├── investment_rating.py
│
▼
ESG Scoring Engine
(Environment / Social / Governance)
│
▼
Investment Sustainability Rating
│
▼
Streamlit Dashboard / CLI Output
Ticker Symbol
│
├─► Fetch market data (yfinance)
│
├─► Generate ESG scores
│
├─► Calculate volatility and financial risk
│
└─► Compute investment sustainability rating
| ESG Tier | Risk Level | Rating |
|---|---|---|
| High | Low | High Sustainability |
| High | Medium | Sustainable Growth |
| Medium | Low | Sustainable Growth |
| Medium | Medium | Sustainable Growth |
| Medium | High | High Risk |
| Low | Any | High Risk |
| Layer | Technology |
|---|---|
| Language | Python |
| API Framework | FastAPI |
| Dashboard | Streamlit |
| Visualization | Plotly |
| Market Data | yfinance |
| Data Processing | Pandas / NumPy |
| HTTP Client | Requests |
| Server | Uvicorn |
esg-investment-analyzer
│
├── main.py
├── dashboard.py
├── market_data.py
├── risk_analysis.py
├── investment_rating.py
├── test_analysis.py
├── requirements.txt
└── README.md
git clone https://github.com/devamithra137/esg-investment-analyzer.git
cd esg-investment-analyzerpython -m venv .venvActivate:
Windows
.venv\Scripts\activateMac / Linux
source .venv/bin/activatepip install -r requirements.txtuvicorn main:app --reload --port 8000API endpoints:
http://localhost:8000/analyze/{ticker}
http://localhost:8000/docs
Open a new terminal:
streamlit run dashboard.pyDashboard:
http://localhost:8501
Run analysis directly from terminal:
python test_analysis.py AAPLMultiple companies:
python test_analysis.py TSLA MSFT NVDA{
"ticker": "AAPL",
"price": 189.40,
"sector": "Technology",
"environment": 71.3,
"social": 74.8,
"governance": 83.5,
"esg_score": 75.8,
"volatility": 0.2312,
"risk_level": "MEDIUM",
"investment_score": 69,
"rating": "Sustainable Growth"
}Annualized volatility is calculated using log returns:
σ = std(log(Pt / Pt-1)) × √252
This reflects the annualized variability of stock returns.
ESG scores are simulated using deterministic sector-based models.
Real ESG data providers typically include:
- MSCI ESG
- Sustainalytics
- Refinitiv
The simulation ensures reproducibility while demonstrating ESG integration in analytics pipelines.
Possible extensions include:
- Real ESG data integration
- Portfolio-level ESG analysis
- ESG screening for multiple tickers
- Database storage for historical analysis
- Docker deployment
- CI/CD automation
- Live ESG news sentiment analysis
This project is for educational purposes only.
- ESG scores are simulated.
- Market data comes from Yahoo Finance.
- This platform does not provide financial advice.
MIT License
Real-Time ESG Investment Analyzer
Built for learning financial analytics and sustainable investment systems.