A comprehensive web application for analyzing historical power demand in Germany and generating short-term forecasts using data from the ENTSOE Transparency Platform.
- Time Series Visualization: Interactive plot of power demand over time
- Daily Patterns: Average hourly load patterns with standard deviation bands
- Weekly Patterns: Average load by day of week
- Monthly Patterns: Seasonal variations throughout the year
- Load Duration Curve: Statistical representation of load distribution
- Heatmap: Hourly load patterns across days of the week
- Yearly Comparison: Multi-year trend comparison
- 7-Day Forecast: Short-term power demand prediction using Facebook Prophet
- Confidence Intervals: Upper and lower bounds for forecast uncertainty
- Model Evaluation: Performance metrics (MAE, RMSE, MAPE)
- Component Analysis: Breakdown of trend, weekly, and daily seasonality
- Interactive Visualization: Zoom, pan, and hover for detailed insights
- Comprehensive statistical summary (mean, median, max, min, std dev)
- Dataset information and metadata
- Raw data viewer with download capability
- Python 3.8 or higher
- pip package manager
- Install dependencies:
pip install -r requirements.txt- Configure API Key (if different):
The API key is already configured in
config.py, but you can modify it if needed.
Start the Streamlit web application:
streamlit run app.pyThe application will open in your default web browser (usually at http://localhost:8501).
- Select Data Period: Use the sidebar to choose the historical data period (30 days to 2 years)
- Set Forecast Horizon: Adjust the forecast horizon from 1 to 14 days
- Explore Tabs:
- Historical Analysis: View various analytical plots and patterns
- Forecast: Generate and view power demand predictions
- Statistics: Review statistical summaries and download data
- Refresh Data: Click the refresh button to fetch the latest data
n3/
├── app.py # Main Streamlit application
├── config.py # Configuration and API key
├── data_fetcher.py # ENTSOE API data retrieval module
├── analyzer.py # Data analysis and visualization module
├── forecaster.py # Forecasting module using Prophet
├── requirements.txt # Python dependencies
├── power_demand_cache.pkl # Data cache (created automatically)
└── README.md # This file
- ENTSOE Transparency Platform: European electricity transmission data
- Resolution: Hourly data
- Country: Germany (DE)
- Data Type: Actual total load (power demand)
The application uses Facebook Prophet, a robust time series forecasting tool that handles:
- Multiple seasonality (hourly, daily, weekly, yearly)
- Trend changes
- Holiday effects
- Missing data
Prophet was chosen for its:
- Strong performance with hourly data
- Automatic handling of seasonality
- Interpretable components
- Robustness to missing data and outliers
- Plotly: Interactive JavaScript-based charts
- Streamlit: Modern Python web framework for data applications
The application uses the ENTSOE Transparency Platform API to fetch power demand data. The API key is provided in config.py.
API Key: 4b504673-4206-4838-a82b-f423f011f3e0
For more information about ENTSOE: https://transparency.entsoe.eu/
-
API Connection Error:
- Check your internet connection
- Verify the API key is valid
- Ensure the ENTSOE service is available
-
Import Errors:
- Ensure all dependencies are installed:
pip install -r requirements.txt - Check Python version (3.8+)
- Ensure all dependencies are installed:
-
Prophet Installation Issues (on macOS):
# If Prophet fails to install, try: pip install pystan==2.19.1.1 pip install prophet==1.1.5 -
Data Cache Issues:
- Delete
power_demand_cache.pklto clear the cache - The file will be recreated on next data fetch
- Delete
- First Load: Initial data fetch may take 30-60 seconds
- Caching: Data is cached locally to improve subsequent loads
- Model Training: Forecast model training takes 10-20 seconds
- Memory: Forecast model is cached in session for better performance
Potential improvements for future versions:
- Multiple country support
- Weather data integration
- Advanced ML models (LSTM, XGBoost)
- Real-time streaming data
- Alert system for anomalies
- Comparison with renewable generation
- Export reports in PDF format
This project uses publicly available data from ENTSOE and open-source libraries.
Created for power system analysis and forecasting demonstrations.
Enjoy analyzing Germany's power demand! ⚡📊