CityCast is a voice-assisted weather application built with Python that:
- Provides real-time weather information for any city in the world
- Suggests clothing based on weather
- Stores weather data in a MySQL database
- Supports both text and voice input
- Uses AI to answer follow-up weather questions
- Detects your location automatically
✅ Real-time Weather — Get current temperature, humidity, and conditions
✅ Voice Interaction — Ask for weather by speaking into your mic
✅ AI Chatbot Integration — Gemini-powered assistant answers weather questions
✅ Follow-up Questions — Continue asking about the same city
✅ Clothing Tips — Suggests what to wear based on weather
✅ Auto Location Detection — Get weather based on IP or location
✅ MySQL Database Logging — Saves every searched city's weather data
- Python 3.x
- OpenWeatherMap API
- Google Gemini AI
- MySQL
- SpeechRecognition
- Pyttsx3 (Text-to-speech)
- Geocoder (IP-based location)
- PyCountry (Full country names)
CREATE DATABASE weather_app;
USE weather_app;
CREATE TABLE city_weather_log (
id INT AUTO_INCREMENT PRIMARY KEY,
city_name VARCHAR(100),
country VARCHAR(100),
temperature FLOAT,
humidity INT,
weather_desc VARCHAR(255),
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);pip install requests mysql-connector-python speechrecognition pyttsx3 geocoder pycountry google-generativeai
API_KEY = "your_openweather_api_key" GEMINI_API_KEY = "your_gemini_api_key"
In bash terminal: python citycast.py
1 → Type your inputs manually
2 → Use your microphone to speak
Search a city → Get weather for any city
My location → Detect your location and fetch weather
Weather chatbot → Ask questions like “Is it raining in Delhi?”
Precise location weather → Use IP to get accurate current location weather
“Search city” → then say “Kolkata”
“Chatbot” → then ask “Will it rain in Mumbai tomorrow?”
“Precise location” → gets your current location via IP
1.Export weather history to CSV 2.Add hourly forecasts 3.GUI version with Tkinter or Streamlit 4.Mobile-friendly version 5.Reminder notifications for rain/cold days
2nd-year Computer Science Student