Weather Data Fetcher is a simple Python script that fetches and displays the current weather data for Denver, Colorado using the OpenWeatherMap API.
This application fetches current weather data for Denver, Colorado. It displays information such as the weather description, temperature, humidity, and atmospheric pressure.
os: For accessing environment variables.requests: To make HTTP requests to the OpenWeatherMap API.dotenv: To load environment variables from an.envfile.
- Fetches real-time weather data using OpenWeatherMap API.
- Displays weather description, temperature, humidity, and pressure.
- Uses environment variables for sensitive data (like API key) ensuring security.
- Install the required libraries:
pip install requests python-dotenv - Create a
.envfile in the root directory and add your OpenWeatherMap API key:OPENWEATHER_API_KEY=your_api_key_here
After setup, simply run the script using:
python denverweather.py