--- 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