This repository provides the SkyCast AI weather dashboard. The deployable app lives in the SkyCast_AI folder at the repository root. Use SkyCast_AI/app.py as the entry point for Streamlit deployments.
SkyCast AI fetches real-time weather and forecast data, visualizes trends, and can be extended with AI-driven insights and alerts.
- 🌡️ Real-time current weather (temperature, humidity, pressure, wind, conditions)
- 📈 Hourly / multi-day forecast with interactive charts
- 📍 Auto-location detection (IP-based) and manual city input
- 🔄 Unit toggle (Celsius / Fahrenheit)
- 🎨 Plotly visualizations and OpenWeatherMap icons
- 🌐 OpenWeatherMap (default): current + 5-day/3-hour forecast endpoints are used when this provider is selected.
- 🌍 WeatherAPI.com: supported as an alternative provider; the app normalizes WeatherAPI responses so the UI can reuse the same display logic (current + sampled forecast entries).
Note: When using WeatherAPI the app samples hourly data (every ~3 hours) to approximate OpenWeatherMap's 3-hour forecast granularity.
- 🐍 Python 3.8+
- 🎯 Streamlit (UI)
- 📡 requests (HTTP)
- 📊 plotly (charts)
- 🗺️ Optional: geopy for enhanced geolocation
- 🌍 OpenWeatherMap API for weather data
- The app uses ipinfo.io (via a simple GET request) to auto-detect city from the user's IP when "Auto-detect from IP" is chosen.
- The repository's
app.pycurrently importsgeopy.geocoders.Nominatimbut geopy is optional; the IP detect path doesn't require geopy.
-
Clone or download the repository.
-
Create and activate a virtual environment (recommended):
Windows (cmd.exe):
python -m venv .venv .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set your OpenWeatherMap API key. You can set an environment variable or enter it in the app when prompted.
Windows (cmd.exe):
setx OPENWEATHER_API_KEY "your_api_key_here"
If you plan to use WeatherAPI.com as the provider, set:
setx WEATHERAPI_KEY "your_weatherapi_key_here"
Note: After running setx you may need to open a new terminal or restart your editor to see the variable.
-
Run the Streamlit app (use the app in
SkyCast_AI):cd SkyCast_AI streamlit run app.pyOr, if streamlit is not on PATH:
python -m streamlit run app.py
The deployable Streamlit app is located at:
SkyCast_AI/app.py— main app for deployment and local run
If you see an older app.py at the repository root, prefer the one in SkyCast_AI for current deployment compatibility.
- 🔑 API key: The app uses the OpenWeatherMap API. Provide a valid API key through the UI or via the
OPENWEATHER_API_KEYenvironment variable. - 🌐 If you select WeatherAPI.com as the provider, provide a WeatherAPI key via the UI or the
WEATHERAPI_KEYenvironment variable. - 📍 Location: Choose between manual city input or auto-detection (IP). Auto-detection can be less accurate depending on your network or VPN.
- 🌡️ Units: Switch between Celsius and Fahrenheit inside the UI.
- 🌐 OpenWeatherMap: icon codes are used to fetch images from OpenWeatherMap's icon endpoint.
- 🌍 WeatherAPI.com: the app converts WeatherAPI responses into an OpenWeatherMap-like shape so the same UI code can display temperature, humidity, description and icons; sunrise/sunset are retrieved from WeatherAPI's forecast endpoint when available.
- ✍️ Add small tests and type hints when extending functionality.
- 📦 When changing requirements, update
requirements.txtand verify the app runs locally.
Contributions, bug reports and feature requests are welcome. Open an issue or submit a pull request with focused changes and a short description.
This project is provided for educational purposes. Check third-party API terms (OpenWeatherMap) before redistributing.
- 🚀 To deploy to Streamlit Cloud, point the service at
SkyCast_AI/app.pyand set theOPENWEATHER_API_KEYin the deployment secrets. - 🔑 If using WeatherAPI in deployment, add
WEATHERAPI_KEYto the project's secrets and choose the provider in the UI. - 💡 If you'd like, I can also:
- Add a minimal
.envexample and updaterequirements.txtif dependencies changed, - Create a short CONTRIBUTING.md and LICENSE file.
- Add a minimal