A simple Python command-line app that fetches the current weather for any city using the OpenWeatherMap API.
It is secure, beginner-friendly, and built using clean Python practices with environment variable support.
- β Real-time weather using city name
- β Metric temperature (Β°C)
- β Handles invalid city names
- β
Uses
.envfor API key security - β Works on any terminal or shell
- Python 3.7 or higher
requestspython-dotenv
git clone https://github.com/ajay-techspace/weather_app.git
cd weather_app
#(Optional)Create a virtual environment
python -m venv .venv
source .venv/bin/activate # On Linux/macOS
# OR
.venv\Scripts\activate # On Windows
#install dependencies
pip install -r requirements.txt
#Run the app
python weather.py
## π§ͺ Sample Output*** Get Current Weather Conditions ***
Please Enter a city name: chennai
Current Weather for Chennai:
The temp is 30.5Β°C
This project is licensed under the MIT License.
You're free to use, modify, and distribute it β even commercially.
See the full license in the LICENSE file.