enerlytics 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
app/__init__.py ADDED
File without changes
app/dashboard.py ADDED
@@ -0,0 +1,121 @@
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import numpy as np
4
+ import matplotlib.pyplot as plt
5
+ from sklearn.linear_model import LinearRegression
6
+ from sklearn.preprocessing import PolynomialFeatures
7
+ import os
8
+
9
+ @st.cache_data
10
+ def load_data():
11
+ current_dir = os.path.dirname(__file__)
12
+ project_root = os.path.dirname(current_dir)
13
+ data_path = os.path.join(project_root, "data", "renewable_energy.csv")
14
+
15
+ if not os.path.exists(data_path):
16
+ raise FileNotFoundError(f"Data file not found: {data_path}")
17
+
18
+ df = pd.read_csv(data_path)
19
+ energy_cols = [
20
+ 'Hydroelectric Power', 'Geothermal Energy', 'Solar Energy',
21
+ 'Wind Energy', 'Wood Energy', 'Waste Energy', 'Biomass Energy',
22
+ 'Total Renewable Energy'
23
+ ]
24
+
25
+ for col in energy_cols:
26
+ if col not in df.columns:
27
+ df[col] = 0.0
28
+ annual = df.groupby('Year')[energy_cols].sum().reset_index()
29
+ return annual
30
+
31
+ annual_data = load_data()
32
+
33
+ st.set_page_config(page_title="Renewable Energy Insights", layout="wide")
34
+ st.title("🌍 U.S. Renewable Energy Insights Dashboard")
35
+ st.markdown("""
36
+ Explore how renewable energy production in the United States has evolved from 1973 to 2024.
37
+ Data source: U.S. Energy Information Administration (EIA).
38
+ """)
39
+
40
+ st.sidebar.header("🔍 Customize View")
41
+ energy_type = st.sidebar.selectbox(
42
+ "Select Energy Source",
43
+ options=[
44
+ "Total Renewable Energy",
45
+ "Solar Energy",
46
+ "Wind Energy",
47
+ "Hydroelectric Power",
48
+ "Geothermal Energy",
49
+ "Biomass Energy",
50
+ "Wood Energy",
51
+ "Waste Energy"
52
+ ]
53
+ )
54
+
55
+ forecast_enabled = st.sidebar.checkbox("Show Forecast (2025–2030)", value=False)
56
+
57
+ st.subheader(f"Annual {energy_type} Production (1973–2024)")
58
+ fig1, ax1 = plt.subplots(figsize=(10, 4))
59
+ ax1.plot(annual_data['Year'], annual_data[energy_type],
60
+ marker='o', linewidth=2, color='tab:blue')
61
+ ax1.set_xlabel("Year")
62
+ ax1.set_ylabel("Production (Trillion Btu)")
63
+ ax1.grid(True, alpha=0.3)
64
+ st.pyplot(fig1)
65
+
66
+ st.subheader(f"Yearly Change in {energy_type}")
67
+ annual_data['Change'] = annual_data[energy_type].diff()
68
+ fig2, ax2 = plt.subplots(figsize=(10, 4))
69
+
70
+ positive = annual_data[annual_data['Change'] >= 0]
71
+ negative = annual_data[annual_data['Change'] < 0]
72
+
73
+ ax2.bar(positive['Year'], positive['Change'], color='green', label='Increase')
74
+ ax2.bar(negative['Year'], negative['Change'], color='red', label='Decrease')
75
+ ax2.axhline(0, color='black', linewidth=0.8)
76
+ ax2.set_xlabel("Year")
77
+ ax2.set_ylabel("Change (Trillion Btu)")
78
+ ax2.legend()
79
+ ax2.grid(axis='y', alpha=0.3)
80
+ st.pyplot(fig2)
81
+
82
+ if forecast_enabled:
83
+ st.subheader(f"Forecast: {energy_type} (2025–2030)")
84
+
85
+ X = annual_data[['Year']].values
86
+ y = annual_data[energy_type].values
87
+
88
+ poly = PolynomialFeatures(degree=2)
89
+ X_poly = poly.fit_transform(X)
90
+ model = LinearRegression()
91
+ model.fit(X_poly, y)
92
+
93
+ future_years = np.arange(2025, 2031).reshape(-1, 1)
94
+ future_poly = poly.transform(future_years)
95
+ future_pred = model.predict(future_poly)
96
+ future_pred = np.maximum(future_pred, 0)
97
+
98
+ all_years = np.concatenate([annual_data['Year'].values, future_years.flatten()])
99
+ all_pred = np.concatenate([model.predict(X_poly), future_pred])
100
+
101
+ fig3, ax3 = plt.subplots(figsize=(10, 4))
102
+ ax3.plot(annual_data['Year'], annual_data[energy_type],
103
+ label='Historical', color='blue', marker='o')
104
+ ax3.plot(all_years, all_pred,
105
+ label='Forecast (Polynomial)', color='orange', linestyle='--')
106
+ ax3.axvline(2024.5, color='gray', linestyle=':', label='Forecast Start')
107
+ ax3.set_xlabel("Year")
108
+ ax3.set_ylabel("Production (Trillion Btu)")
109
+ ax3.legend()
110
+ ax3.grid(True, alpha=0.3)
111
+ st.pyplot(fig3)
112
+
113
+
114
+ forecast_df = pd.DataFrame({
115
+ 'Year': future_years.flatten(),
116
+ f'{energy_type} (Forecast)': future_pred
117
+ })
118
+ st.dataframe(forecast_df.round(2))
119
+
120
+ st.markdown("---")
121
+ st.caption("Built with using Streamlit | Data: U.S. Renewable Energy Consumption")
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: enerlytics
3
+ Version: 0.1.0
4
+ Summary: Renewable energy insights dashboard — data-driven exploration of energy systems and consumption patterns.
5
+ Author-email: Huseyin Kucukogul <huseyinkucukogulcontact@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Huseyin
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/Kucukogul/enerlytics
29
+ Project-URL: Repository, https://github.com/Kucukogul/enerlytics
30
+ Keywords: energy,renewable energy,data science,dashboard,analytics
31
+ Classifier: Development Status :: 3 - Alpha
32
+ Classifier: Intended Audience :: Science/Research
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Programming Language :: Python :: 3
35
+ Classifier: Programming Language :: Python :: 3.10
36
+ Classifier: Programming Language :: Python :: 3.11
37
+ Classifier: Topic :: Scientific/Engineering
38
+ Requires-Python: >=3.10
39
+ Description-Content-Type: text/markdown
40
+ License-File: LICENSE
41
+ Requires-Dist: pandas>=1.5.0
42
+ Requires-Dist: numpy>=1.24.0
43
+ Requires-Dist: plotly>=5.0.0
44
+ Requires-Dist: streamlit>=1.20.0
45
+ Dynamic: license-file
46
+
47
+ # 🌍 Renewable Energy Insights Dashboard
48
+
49
+ The **Renewable Energy Insights Dashboard** is a data analysis project focused on the **United States**, exploring how renewable energy production — including solar, wind, hydroelectric, geothermal, and biomass — has evolved from 1973 to 2024. By transforming raw U.S. Energy Information Administration (EIA) data into interactive insights, this project supports data-driven decisions for a sustainable energy future.
50
+
51
+ ---
52
+
53
+ ## 🎯 Objectives
54
+
55
+ - Analyze U.S. renewable energy production by **year, energy source, and sector** (e.g., electric power, industrial)
56
+ - Identify long-term **growth trends** and **structural shifts** in energy mix
57
+ - Create **interactive visualizations** to reveal patterns and anomalies
58
+ - Deliver insights through a user-friendly **Streamlit dashboard**
59
+
60
+ ---
61
+
62
+ ## 🧩 Tech Stack
63
+
64
+ | Category | Tools / Libraries |
65
+ |------------------|---------------------------------------|
66
+ | Programming | Python |
67
+ | Data Handling | Pandas, NumPy |
68
+ | Visualization | Matplotlib, Seaborn, Plotly |
69
+ | Dashboard | Streamlit |
70
+ | Deployment | Streamlit Cloud / Render |
71
+ | Version Control | Git & GitHub |
72
+
73
+ ---
74
+
75
+ ## 📊 Features
76
+
77
+ ✅ Clean and aggregate monthly EIA data into **annual totals**
78
+ ✅ Visualize **historical trends (1973–2024)** by energy type
79
+ ✅ Compare contributions of **solar, wind, hydro, geothermal, biomass, and waste**
80
+ ✅ Interactive Streamlit dashboard with dynamic filtering
81
+ ✅ Modular design — ready to extend with **time-series forecasting** (e.g., Prophet, ARIMA)
@@ -0,0 +1,8 @@
1
+ app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ app/dashboard.py,sha256=ilnL8nTrB671gReVVWYmReA0nSTNmLQmNmd4WfhGUKw,4102
3
+ enerlytics-0.1.0.dist-info/licenses/LICENSE,sha256=vJ8RYmKotKanM5U3ok_JQHJGSFy4HWweYlXM_pACprw,1085
4
+ enerlytics-0.1.0.dist-info/METADATA,sha256=uJiFUTRUtvDLuxF2TQ0RoKAShOZyDvy5fYjDTwacXms,3985
5
+ enerlytics-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
6
+ enerlytics-0.1.0.dist-info/entry_points.txt,sha256=IdMaOONu2ZmzJO6g3exVCJ-PEPlh8pAACbcfcRyVbhw,57
7
+ enerlytics-0.1.0.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
8
+ enerlytics-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ enerlytics = enerlytics.dashboard:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Huseyin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ app