This repository contains a "Deep Vertical" ESG (Environmental, Social, Governance) Financial Analytics Engine designed for the Pharmaceutical sector (specifically tailored for RPG Life Sciences). Moving beyond basic sustainability reporting, this project utilizes Python, Machine Learning, and Live API pipelines to quantify climate risk in financial terms. It translates vague ESG metrics into actionable CapEx decisions, ROI calculations, and strategic forecasts. 🚀 Key Modules & Features
- 📉 Financial & Market Analytics • Live Data Siphoning: Streams real-time stock data (NSE), GDP growth (World Bank), and Carbon Intensity (Our World in Data) to visualize Macro-ESG tensions. • Risk Profiling: Calculates Stock Beta and 60-day Rolling Volatility to assess "Defensive" vs. "Aggressive" market positioning. • Correlation Matrix: Analyzes the "decoupling" challenge between financial returns and carbon intensity.
- ⚡ Net-Zero Strategy & Engineering • Marginal Abatement Cost Curve (MACC): An optimizer that ranks decarbonization projects (e.g., LED Retrofit, Solar PPA) by cost-efficiency (₹ per Tonne CO2) to maximize budget impact. • Solar Feasibility Engine: Connects to Open-Meteo Satellite APIs to retrieve hourly solar radiation data for specific GPS coordinates (Ankleshwar), calculating generation potential (kWh) and carbon avoidance. • Green Chemistry Optimizer: Compares "Dirty" vs. "Green" solvents using Process Mass Intensity (PMI) and financial modeling to prove that eco-friendly manufacturing reduces OpEx.
- 🌪️ Risk Management (Climate & Supply Chain) • Monte Carlo Simulation: Predicts financial Value-at-Risk (VaR) from potential Carbon Taxes using 10,000 scenario runs. • Supply Chain Digital Twin: Maps global suppliers against climate hazards (Flood/Drought) and Sovereign Governance risk (World Bank Data) to identify "Zones of Death" in the procurement network. • TNFD Nature Risk Locator: Implements the LEAP framework to map manufacturing sites against water stress and biodiversity intactness indices.
- ⚖️ Governance & Social Intelligence • NLP Greenwashing Detector: Uses TextBlob to audit Annual Reports, scoring sections based on "Vagueness vs. Data" ratios to flag regulatory risks. • Sentiment Analysis: Scrapes and analyzes news headlines to track real-time ESG sentiment trends for the Indian Pharma sector. • Human Rights Due Diligence: A matrix scoring system to prioritize supplier audits based on Modern Slavery risks (Commodity vs. Country risk).
🛠️ Tech Stack • Core: Python 3.x, Pandas, NumPy • Visualization: Matplotlib, Seaborn (Custom "Consultant" Aesthetics) • Machine Learning: Scikit-Learn (Linear Regression for Emissions Forecasting) • NLP: TextBlob (Sentiment & Vagueness Analysis) • Live APIs: ◦ yfinance (Stock & Commodity Futures) ◦ requests (World Bank, Open-Meteo, OWID)
📊 Sample Insights generated by this Repo
- Solar Viability: The Ankleshwar plant has "Low Yield" potential; a Wind-Solar Hybrid PPA is recommended over rooftop solar.
- Green Chemistry: Switching to Ethyl Acetate is profitable (saving ~₹6.2 Lakhs/batch) due to high hazardous waste disposal costs of traditional solvents.
- Governance Risk: The "CEO Message" and "Supply Chain" sections of the annual report were flagged as High Risk for greenwashing due to a lack of quantitative targets.
- Strategic CapEx: "Water Scarcity" is identified as a critical priority in the Double Materiality Matrix, necessitating immediate ZLD (Zero Liquid Discharge) investment.
📥 Installation & Usage
- Clone the repository
- Install dependencies:
- Run the Analysis: Open ESG.ipynb in JupyterLab or VS Code. Note that sections marked "STRICT MODE" require an active internet connection to siphon live API data.
Disclaimer: This project uses a mix of live market data and simulated operational data for demonstration purposes.