A simple and responsive weather app that fetches real-time weather data for any city using the OpenWeatherMap API. Built with Python, HTML, CSS, and JavaScript, this app is designed to look modern and work seamlessly.
- Fetches current weather details for any city worldwide.
- Displays weather description and temperature in Celsius.
- Responsive and user-friendly design.
- Built with a Python backend and a clean frontend.
- Backend: Python (
requests
library) - Frontend: HTML, CSS, JavaScript
- API: OpenWeatherMap
- Python 3 installed on your system.
- A valid API key from OpenWeatherMap.
git clone https://github.com/your-username/weather-app.git
cd weather-app
- Open the Python file (
weather.py
). - Replace
API_KEY
with your OpenWeatherMap API key. - Run the backend script:
python weather.py
- Serve the HTML file locally using Python's HTTP server:
python -m http.server
- Open your browser and navigate to:
http://localhost:8000
- Enter a city name in the input box.
- Click Get Weather to fetch and display the current weather and temperature.
weather-app/
├── index.html # Main HTML file for the frontend
├── styles.css # CSS for styling the app
├── script.js # JavaScript for API calls and user interaction
├── weather.py # Python script for backend functionality
└── README.md # Documentation file
- Add more weather details like humidity, wind speed, and forecast.
- Enhance the app with geolocation support to detect the user's location.
- Add error handling for various edge cases.
- Make it a fully-fledged web application using Flask or Django.
This project is licensed under the MIT License.
Feel free to use, modify, and distribute it.
Contributions are welcome!
If you have any ideas or improvements, feel free to submit a pull request.