import requests
from colorama import Fore, Style

def get_weather(city_name):
    api_key = 'b6b6125ac7c08e7e1c3aa1e757b970e3'
    url = f'http://api.openweathermap.org/data/2.5/weather?q={city_name}&appid={api_key}&units=metric'
    
    response = requests.get(url)
    data = response.json()
    
    if response.status_code == 200:
        weather_info = {
            'Temperature': data['main']['temp'],
            'Humidity': data['main']['humidity'],
            'Wind Speed': data['wind']['speed']
        }
        return weather_info
    else:
        return None

def display_weather(weather_info, city_name):
    if weather_info:
        print(Fore.GREEN + f"Weather in {city_name}:" + Style.RESET_ALL)
        for key, value in weather_info.items():
            print(f"{key}: {value}")
    else:
        print(Fore.RED + "Error: Unable to fetch weather data. Please check your input." + Style.RESET_ALL)

def main():
    city_name = input(Fore.BLUE + "Enter city name: " + Style.RESET_ALL)
    
    weather_info = get_weather(city_name)
    display_weather(weather_info, city_name)

if __name__ == "__main__":
    main()
