import requests
from datetime import *

# response = requests.get("http://api.open-notify.org/iss-now.json")
#
# data = response.json()
#
# latitude = data["iss_position"]["latitude"]
# longitude = data["iss_position"]["longitude"]
#
# iss_position = (latitude, longitude)
#
# print(iss_position)

parameters = {
    "lat": 25.016551,
    "lng": 67.122834,
    "formatted": 0,
}

response = requests.get("https://api.sunrise-sunset.org/json", params=parameters)
response.raise_for_status()
data = response.json()
sunrise = data["results"]["sunrise"].split("T")[1].split(":")[0]
sunset = data["results"]["sunset"].split("T")[1].split(":")[0]
print(sunrise)
print(sunset)

current_datetime = datetime.now()
print(current_datetime.hour)
