Spaces:
Build error
Build error
Delete utils.py
Browse files
utils.py
DELETED
|
@@ -1,14 +0,0 @@
|
|
| 1 |
-
import requests
|
| 2 |
-
|
| 3 |
-
def fetch_tariff_data():
|
| 4 |
-
"""Fetch tariff data from the WAPDA website."""
|
| 5 |
-
# Example URL, replace with actual
|
| 6 |
-
url = "https://example-wapda-tariff.com/api"
|
| 7 |
-
response = requests.get(url)
|
| 8 |
-
return response.json()
|
| 9 |
-
|
| 10 |
-
def calculate_bill(load, usage_hours, tariff_data):
|
| 11 |
-
"""Calculate the monthly electricity bill."""
|
| 12 |
-
total_units = (load / 1000) * usage_hours * 30 # kWh
|
| 13 |
-
rate = tariff_data.get("rate_per_unit", 0)
|
| 14 |
-
return round(total_units * rate, 2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|