WeatherApp_Demo / README.md
SharmilNK's picture
Update README.md
4e1c1fe verified
---
title: My Streamlit Demo
emoji: πŸš€
colorFrom: red
colorTo: red
sdk: streamlit
app_port: 8501
tags:
- streamlit
pinned: false
short_description: Fetch and display real-time weather data for any city.
---
# Welcome to Streamlit!
Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
forums](https://discuss.streamlit.io).
# 🌦️ Weather Information App
A simple **Streamlit** application that fetches and displays real-time weather data for any city in the world using the **OpenWeatherMap API**.
The app also gives **practical suggestions** (e.g., bring a jacket or umbrella) along with weather icons.
---
## πŸš€ Features
- Fetch current weather data from [OpenWeatherMap API](https://openweathermap.org/api)
- Displays:
- 🌑️ Temperature (°C)
- πŸ’§ Humidity (%)
- πŸ“ Weather description
- πŸ”” Personalized suggestion with an icon
- Clean layout: image on the left, advice & details on the right
---
## πŸ§ͺ Python Version
This app was developed using: Python 3.10
## πŸš€ Demo
> Deployed on [Hugging Face Spaces] https://huggingface.co/spaces/SharmilNK/my-streamlit-demo
## πŸ“‚ Project Structure
Assignment/
│── streamlit_app.py # Main Streamlit app
│── requirements.txt # Dependencies
│── README.md
│── images/ # Weather image icons
β”‚ β”œβ”€β”€ chill.jpg
β”‚ β”œβ”€β”€ cloudy.jpg
β”‚ β”œβ”€β”€ rain.jpg
β”‚ β”œβ”€β”€ shower.jpg
β”‚ β”œβ”€β”€ sun.jpg
β”‚ β”œβ”€β”€ weather.jpg
## Setup Instructions
### 1. Clone the Repo
```bash
1. git clone https://github.com/SharmilNK/WeatherApp-using-Streamlit_W5CH2.git
cd Assignment
2. Create & activate a virtual environment (optional but recommended)
python -m venv venv
venv\Scripts\activate # On Windows
source venv/bin/activate # On Mac/Linux
3. Create a .env file
Inside Assignment/, create a file called .env and add your API key:
OPENWEATHER_API_KEY=your_api_key_here
4. Install dependencies
pip install -r requirements.txt
5. Run the Streamlit app
streamlit run app.py
5. Deploy to Hugging Face Spaces
6. Go to your Space's Settings tab
Use "Secrets" to securely store your API key
### 2.Run on Hugging Face Spaces
1. Upload the following files:
main.py
requirements.txt
.streamlit/config.toml
images/ folder (with weather icons)
README.md
2. Set your API key:
Go to your Space β†’ Settings β†’ Secrets
Add a key like:
OPENWEATHER_API_KEY = your_key_here
The app will automatically reload and work!
πŸ™ Acknowledgements
OpenWeatherMap API
Streamlit
Hugging Face Spaces