A professional, feature-rich weather application built with Streamlit that provides real-time weather data, 30-day forecasts, and interactive data visualizations.
The AI Weather App delivers comprehensive weather insights for any location worldwide. It leverages the OpenWeatherMap API and Open-Meteo Archive API to fetch current conditions and historical weather data, presenting information through an intuitive web interface with advanced analytics.
✨ Current Weather Metrics
- Real-time temperature, humidity, and wind speed
- "Feels like" temperature index
- Live weather conditions with descriptions
- Dynamic local time display for searched locations
- Precise latitude/longitude coordinates
📈 Historical Analysis (30-Day Reports)
- Maximum and minimum temperature trends
- Rainfall data visualization
- Daily weather metrics archived automatically
- Interactive graphs with date range navigation
📊 Data Visualization
- Matplotlib-powered interactive charts
- Temperature trend analysis
- Precipitation patterns
- Responsive, mobile-friendly layouts
⚡ Live Updates
- Real-time clock synchronized to location timezone
- Auto-refreshing weather metrics
- Seamless API integration with error handling
| Component | Technology |
|---|---|
| Frontend | Streamlit |
| Data Processing | Pandas, NumPy |
| Visualization | Matplotlib, Scikit-learn |
| Weather APIs | OpenWeatherMap, Open-Meteo |
| Language | Python 3.x |
| Analysis | Jupyter Notebooks, SciPy |
WeatherApp/
├── app.py # Main Streamlit application
├── weatherreport.py # 30-day weather report generator
├── hourly_weatherreport.py # Hourly weather data fetcher
├── weather_data.py # Weather data utilities
├── Weathergraphs.py # Graph plotting functions
├── model.ipynb # ML model development notebook
├── graphs.ipynb # Data visualization notebook
├── requirements.txt # Python dependencies
├── test.py # Unit tests
├── hourly_weather.csv # Hourly weather cache
├── weather_last_30_days.csv # 30-day historical data
└── .streamlit/ # Streamlit configuration
- Python 3.8+
- pip or conda package manager
- OpenWeatherMap API Key (Get one free)
git clone https://github.com/yourusername/WeatherApp.git
cd WeatherApp# Using venv
python -m venv .venv
# Activate virtual environment
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activatepip install -r requirements.txtCreate or update .streamlit/secrets.toml:
api_key = "your_openweathermap_api_key_here"
AI_API_KEY = "your_nvidia_api_key_here"Get a weather API key from OpenWeatherMap and an inference API key from NVIDIA. Keep both keys private; do not commit secrets.toml.
streamlit run app.pyThe app will open at http://localhost:8501
Generate 30-day reports for specific coordinates:
# For Kolkata (default)
python weatherreport.py
# For custom location
python weatherreport.py --lat 40.7128 --lon -74.0060 # New Yorkpython hourly_weatherreport.pySet the API key as an environment variable (alternative to secrets.toml):
# Windows
set OPENWEATHER_API_KEY=your_api_key
# macOS/Linux
export OPENWEATHER_API_KEY=your_api_key| Package | Version | Purpose |
|---|---|---|
streamlit |
Latest | Web framework |
pandas |
Latest | Data manipulation |
numpy |
Latest | Numerical computing |
matplotlib |
Latest | Data visualization |
requests |
Latest | HTTP requests |
scikit-learn |
Latest | ML utilities |
scipy |
Latest | Scientific computing |
See requirements.txt for complete list.
- Displays real-time metrics in an intuitive card layout
- Shows location coordinates
- Automatically generates 30-day historical report
- Displays historical weather data table
- Interactive graphs of temperature trends
- Rainfall patterns over 30 days
- Matplotlib-powered visualizations
- Responsive design for all screen sizes
- Configure the NVIDIA model, generation temperature, and system prompt
- Open the AiWeatherApp GitHub repository
- Inspect the raw weather API response as JSON
Run the test suite:
python test.pyThe application includes robust error handling:
- City Not Found: Returns user-friendly error message
- Connection Failures: Graceful timeout handling
- Missing API Key: Clear instructions for configuration
- Data Processing Errors: Fallback mechanisms
- Caching of weather data in CSV format
- Efficient DataFrame operations with Pandas
- Optimized graph rendering with Matplotlib
- Smart API request management
- Chrome/Chromium (Recommended)
- Firefox
- Safari
- Edge
- Mobile browsers (iOS Safari, Chrome Mobile)
streamlit run app.py --logger.level=debug# Lint check
pylint *.py
# Format code
black *.pyThe project includes interactive notebooks for analysis:
- model.ipynb: Machine learning model development
- graphs.ipynb: Data visualization experiments
Open with:
jupyter notebook model.ipynbContributions are welcome! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Make your changes
- Write/update tests
- Submit a pull request
| Issue | Solution |
|---|---|
| API Key not found | Check .streamlit/secrets.toml file exists |
| City not found error | Verify city name spelling |
| Connection timeout | Check internet connection, API service status |
| CSV file not found | Run weatherreport.py to generate data |
| Import errors | Run pip install -r requirements.txt again |
This project is licensed under the MIT License - see LICENSE file for details.
Shirshadip - GitHub Profile
- 🙏 OpenWeatherMap for weather API
- 🙏 Open-Meteo for historical weather data
- 🙏 Streamlit for the web framework
- 🙏 Community contributors
For issues, questions, or suggestions:
- 📧 Email: [mailto:shirshadiphere@gmail.com]
- 🐛 Report a Bug
- 💡 Request a Feature
⭐ If you find this project helpful, please consider giving it a star!
Last Updated: June 2026