Spaces:
Sleeping
Sleeping
Jonas Neves commited on
Commit Β·
d09c081
1
Parent(s): cff1430
Update README and requirements
Browse files- README.md +50 -8
- requirements.txt +1 -1
README.md
CHANGED
|
@@ -1,19 +1,61 @@
|
|
| 1 |
---
|
| 2 |
title: Weather App
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
app_port: 8501
|
| 8 |
tags:
|
| 9 |
- streamlit
|
|
|
|
| 10 |
pinned: false
|
| 11 |
-
short_description:
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Weather App
|
| 3 |
+
emoji: π€οΈ
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: lightblue
|
| 6 |
sdk: docker
|
| 7 |
app_port: 8501
|
| 8 |
tags:
|
| 9 |
- streamlit
|
| 10 |
+
- weather
|
| 11 |
pinned: false
|
| 12 |
+
short_description: A weather app built with Streamlit
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# π€οΈ Weather Web App
|
| 16 |
|
| 17 |
+
A interactive web application built with Streamlit to get current weather information for any city.
|
| 18 |
|
| 19 |
+
## How It Works
|
| 20 |
+
|
| 21 |
+
The app runs a server that users can interact with through their browser in a continuous loop:
|
| 22 |
+
|
| 23 |
+
```mermaid
|
| 24 |
+
sequenceDiagram
|
| 25 |
+
participant U as π€ User
|
| 26 |
+
participant B as π Browser
|
| 27 |
+
participant S as π Server
|
| 28 |
+
participant W as π API
|
| 29 |
+
|
| 30 |
+
U->>B: Visits app URL
|
| 31 |
+
B->>S: Loads page
|
| 32 |
+
S->>B: Shows input form
|
| 33 |
+
|
| 34 |
+
loop π Each Search
|
| 35 |
+
U->>B: Enters city & clicks "Get Weather"
|
| 36 |
+
B->>S: Sends city name
|
| 37 |
+
S->>W: π Fetches weather
|
| 38 |
+
W->>S: Sends data
|
| 39 |
+
S->>B: Updates with weather info
|
| 40 |
+
B->>U: π Displays results
|
| 41 |
+
end
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
## Run Locally
|
| 45 |
+
|
| 46 |
+
1. Get an API key from [OpenWeatherMap](https://home.openweathermap.org/users/sign_up)
|
| 47 |
+
2. Copy `.env.example` to `.env` and add your key
|
| 48 |
+
3. Install deps: `pip install -r requirements.txt`
|
| 49 |
+
4. Run: `streamlit run src/streamlit_app.py`
|
| 50 |
+
|
| 51 |
+
## Deploy on Hugging Face
|
| 52 |
+
|
| 53 |
+
1. Push code to a GitHub repo
|
| 54 |
+
2. Create a new Streamlit Space on HF
|
| 55 |
+
3. **Add your API key as a secret** in Space Settings:
|
| 56 |
+
- Name: `OPENWEATHER_API_KEY`
|
| 57 |
+
- Value: `your_actual_key_here`
|
| 58 |
+
|
| 59 |
+
## License
|
| 60 |
+
|
| 61 |
+
MIT License - feel free to use this project for learning and development!
|
requirements.txt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
requests==2.31.0
|
| 2 |
python-dotenv==1.0.0
|
| 3 |
-
streamlit
|
|
|
|
| 1 |
requests==2.31.0
|
| 2 |
python-dotenv==1.0.0
|
| 3 |
+
streamlit==1.28.1
|