Skip to content

eilaytal/weather-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather App

A simple weather application built with Flask that retrieves and displays weather data for a specified location. It also allows users to download the search history.

Related Repositories

Features

  • Fetches weather data using the Open-Meteo API.
  • Displays current weather conditions including maximum and minimum temperatures and humidity.
  • Saves search history and allows users to download it.
  • Responsive and user-friendly interface.

Project Structure

weatherapp/
├── app.py
├── requirements.txt
├── templates/
│   ├── index.html
│   └── download_history.html
├── testing.py
├── weather.py
└── Dockerfile

Installation

Clone the repository:

git clone https://github.com/eilaytal/weather-app.git
cd weatherapp

Create a virtual environment and activate it (optional but recommended):

python3 -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`

Install dependencies:

pip install -r requirements.txt

Usage

Run the application:

python app.py

Open your web browser and navigate to https://127.0.0.1:5000/weather.

Enter a city name to get the weather forecast.

Routing

/weather [GET, POST]

  • GET: Renders the main page with a form to input the city name.
  • POST: Processes the city name submitted by the user, fetches the weather data, and displays it.

/weather/download_history [GET]

  • Lists all the files in the search_history directory, allowing users to see their search history.

/weather/history_files/ [GET]

  • Downloads the specified search history file.

Running Tests

To run the tests, use the following command:

python -m unittest discover tests

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.


This README.md file now includes the project structure with the Dockerfile included.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published