A Python-based weather application that displays current weather information for any ZIP code using the WeatherStack API.
- Clean, modern UI built with Kivy
- Real-time weather data from WeatherStack
- Displays temperature, location, time, and weather conditions
- Weather condition icons
- Save and manage favorite locations
- Responsive design that works on different screen sizes
- Clone the repository:
git clone <your-repo-url>
cd SimpleWeatherApp- Create and activate a virtual environment (recommended):
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On Unix or MacOS:
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt-
Set up environment variables:
- Copy
.env.exampleto.env:cp .env.example .env
- Get your API key from WeatherStack
- Edit
.envand replaceyour_api_key_herewith your actual WeatherStack API key
- Copy
-
Run the application:
python main.pyFor development, you can install the package in development mode:
pip install -e .This will allow you to modify the code and see changes immediately without reinstalling.
The application uses the following environment variables:
WEATHERSTACK_API_KEY: Your WeatherStack API key
These should be placed in a .env file in the root directory. A template is provided in .env.example.
SimpleWeatherApp/
├── main.py # Application entry point
├── requirements.txt # Python dependencies
├── setup.py # Package setup file
├── .env.example # Environment variables template
├── src/
│ └── weather_app/
│ ├── api/ # Weather API client
│ ├── ui/ # Kivy UI components
│ └── storage/ # Location storage
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
To run the test suite:
- Install test dependencies:
pip install -r requirements-test.txt- Run tests with coverage:
pytest tests/ --cov=weather_app --cov-report=htmlThis will run all tests and generate a coverage report in the htmlcov directory.
The test suite is organized into three categories:
-
Unit Tests (
tests/unit/):test_weather_client.py: Tests for the WeatherStack API clienttest_location_storage.py: Tests for location data storage
-
UI Tests (
tests/ui/):test_weather_app.py: Tests for the main application UI
-
Integration Tests (
tests/integration/):- Tests for component interactions
The test suite covers:
- API client functionality
- Location storage operations
- UI component behavior
- Error handling
- Resource cleanup
- Keyboard event handling
When adding new features, please follow these guidelines:
- Add unit tests for new functionality
- Update integration tests if component interactions change
- Add UI tests for new UI components
- Ensure all tests pass before submitting changes
- Maintain or improve code coverage