You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modify Data Pipeline to perform Global Energy Transition Analysis
- Implement Global Energy Transition Analysis Pipeline in pipeline.py, replacing sample data generation with real-time data fetching from World Bank API.
- Enhance data processing with energy transition metrics and regional analysis.
- Add interactive visualizations using Plotly and a web dashboard with Dash.
- Update README.md to reflect new features and usage instructions. Modify requirements.txt to include necessary libraries for data fetching and visualization.
Copy file name to clipboardExpand all lines: README.md
+48-15Lines changed: 48 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,16 @@
1
-
# Simple Data Pipeline with Prefect
1
+
# Global Energy Transition Analysis Pipeline with Prefect
2
2
3
-
This project demonstrates a simple data pipeline using Prefect. The pipeline generates sample data, processes it by adding derived columns, and saves the results to a CSV file.
3
+
This project implements a data pipeline that analyzes global energy consumption and renewable energy adoption data from the World Bank. The pipeline tracks energy transition progress across countries and regions, providing insights into the shift towards sustainable energy sources.
4
+
5
+
## Features
6
+
7
+
- Real-time data fetching from World Bank API
8
+
- Multi-indicator energy analysis
9
+
- Regional trend analysis
10
+
- Interactive visualizations using Plotly
11
+
- Web dashboard using Dash
12
+
- Automated report generation
13
+
- Prefect workflow management
4
14
5
15
## Setup
6
16
@@ -23,11 +33,16 @@ python pipeline.py
23
33
```
24
34
25
35
The pipeline will:
26
-
1. Generate sample time series data
27
-
2. Process the data by adding:
28
-
- 7-day rolling mean
29
-
- Boolean flag indicating if value is above mean
30
-
3. Save the processed data to a CSV file with timestamp
36
+
1. Fetch the latest energy consumption data from World Bank
37
+
2. Process and analyze energy transition metrics
38
+
3. Generate interactive visualizations
39
+
4. Create a web dashboard
40
+
5. Generate a summary report
41
+
42
+
Outputs:
43
+
- Interactive visualizations in the `output` directory
44
+
- Summary report in `output/energy_report.txt`
45
+
- Web dashboard available at http://localhost:8050
31
46
32
47
## Cloud Deployment
33
48
@@ -40,6 +55,7 @@ The pipeline will:
40
55
- Go to your GitHub repository settings
41
56
- Navigate to Secrets and Variables > Actions
42
57
- Add a new secret named `PREFECT_API_KEY` with your Prefect Cloud API key
58
+
- Add a new secret named `PREFECT_WORKSPACE` with your workspace name
43
59
44
60
### GitHub Actions
45
61
@@ -58,13 +74,30 @@ To run the pipeline manually:
58
74
-`pipeline.py`: Main pipeline script containing the Prefect flow and tasks
Generated on: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}
154
+
155
+
Key Statistics:
156
+
--------------
157
+
Total Countries Analyzed: {len(latest_data)}
158
+
Global Average Renewable Energy Share: {latest_data['Renewable energy consumption (% of total final energy consumption)'].mean():.2f}%
159
+
160
+
Top 5 Countries by Renewable Energy Share:
161
+
----------------------------------------
162
+
{latest_data.nlargest(5, 'Renewable energy consumption (% of total final energy consumption)')[['country', 'Renewable energy consumption (% of total final energy consumption)']].to_string()}
0 commit comments