Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather App

A simple desktop weather application built with Python and Tkinter that displays current weather and 4-day forecast for any city.

Features

  • Current Weather: Displays today's temperature, weather description, and icon
  • 4-Day Forecast: Shows daily minimum/maximum temperatures with weather icons
  • City Search: Enter any city name to get weather information
  • User-Friendly GUI: Clean and intuitive interface using Tkinter

Requirements

  • Python 3.6+
  • Required packages (automatically installed via requirements.txt):
    • requests
    • python-dotenv
    • tkinter (usually included with Python)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd weather-app
  2. Install dependencies:

    pip install -r requirements.txt
  3. Set up environment variables:

    • Copy .env.example to .env
    • Get your OpenWeatherMap API key from OpenWeatherMap
    • Add your API key to .env file:
      OPENWEATHER_API_KEY=your_api_key_here
      
  4. Run the application:

    python main.py

Usage

  1. Launch the application by running python main.py
  2. Enter a city name in the text field (default is "Belgrade")
  3. Click "Get Weather" to fetch and display weather information
  4. View current weather and 4-day forecast with icons

Project Structure

weather-app/
├── main.py               # Application entry point
├── requirements.txt      # Python dependencies
├── .env.example          # Environment variables template
├── .env                  # Environment variables (not committed)
├── src/
│   ├── api.py             # Weather API integration
│   └── gui.py             # GUI implementation
├── assets/
│   └── icons/             # Weather icons
├── example.json          # Sample API response
├── .gitignore            # Git ignore rules
└── README.md             # This file

API Key Setup

Important: The application uses OpenWeatherMap API. The free tier allows 1000 calls per day.

Security Note: Never commit your .env file to version control. It's already included in .gitignore.

Environment Variables

The application uses the following environment variable:

  • OPENWEATHER_API_KEY: Your OpenWeatherMap API key

Icons

Weather icons are stored in the assets/icons/ directory. The application expects PNG files named after OpenWeatherMap icon codes (e.g., 01d.png, 02n.png, etc.). Icons can be downloaded from Dovora Weather Icons or other free weather icon sets.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Credits

  • Weather data provided by OpenWeather
  • Weather icons provided by Dovora (Free for commercial use with attribution)

License

This project is open source and available under the MIT License.

Disclaimer

This application is for educational purposes. Weather data is provided by OpenWeatherMap and may not be 100% accurate. Always check official weather sources for critical decisions.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages