Skip to content

Commit b0900a4

Browse files
committed
add more to readme
1 parent f5b0619 commit b0900a4

File tree

5 files changed

+48
-8
lines changed

5 files changed

+48
-8
lines changed

README.md

+44-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,48 @@
11
# wdash
2-
a weather dashboard built from OpenWeatherMaps APi, MongoDB, and Plotly Dash
2+
a weather dashboard built from OpenWeatherMaps APi, MongoDB, Windy, and Plotly Dash
33

44

5-
todo:
5+
![demo](demo.gif)
6+
7+
8+
# Configure
9+
10+
All the variables needed to configure `wdash` are in `config.yml`.
11+
12+
## `CITY_ID`
13+
The city ID (an integer) for your city as per [OpenWeatherMaps search API](https://openweathermap.org/find). Enter your city and country name and the resulting url (e.g., https://openweathermap.org/city/5403676) contains the integer city ID (in this example, 5403676).
14+
15+
16+
## `DB_HOST`
17+
The host of your mongodb instance, e.g., `localhost`
18+
19+
## `DB_PORT`
20+
The port of your mongodb instance, e.g., 27017
21+
22+
## `DB_NAME`
23+
The name of the mongodb database you'd like to use or create to hold your wdash data, e.g., `wdash`
24+
25+
## `INTERVAL`
26+
The inteval to update (gather current weathers and forecasts), in seconds. The default `1800` corresponds to every 30 minutes.
27+
28+
## `PORT`
29+
The port you'd like the `wdash` interface to run on.
30+
31+
## `API_KEY`
32+
Your OpenWeatherMaps API key. Only the free-tier API key is required for full functionality.
33+
34+
## `WINDY_EMBED`
35+
The embeddable url for your windy map, which you can obtain from [Windy](https://www.windy.com/-Embed-widget-on-page/widgets?39.339,-120.173,5)
36+
37+
38+
# Running `wdash`
39+
40+
Simply run
41+
42+
43+
```
44+
source run.sh
45+
```
46+
47+
In the `wdash` directory for the daemon and app to run in the background. All output will be logged to `log.txt` in the `wdash` directory.
648

7-
- add weather codes to heatmap: https://openweathermap.org/weather-conditions
8-
- fix app title

app.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
NAME = CONFIG["DB_NAME"]
2828
INTERVAL = CONFIG["INTERVAL"]
2929
SERVER_PORT = CONFIG["PORT"]
30+
WINDY_EMBED = CONFIG["WINDY_EMBED"]
31+
3032

3133
mc = MongoClient(host=HOST, port=PORT)
3234
cw = mc[NAME].weather_current
@@ -574,7 +576,7 @@ def generate_page(n_intervals):
574576
common_style = {"width": "95%", "height": "700px", "margin": "auto", "border": "30px"}
575577
widget = html.Iframe(
576578
style=common_style,
577-
src="https://embed.windy.com/embed2.html?lat=39.339&lon=-120.173&detailLat=39.339&detailLon=-120.173&width=650&height=450&zoom=5&level=surface&overlay=wind&product=ecmwf&menu=&message=&marker=&calendar=now&pressure=&type=map&location=coordinates&detail=&metricWind=mph&metricTemp=%C2%B0F&radarRange=-1"
579+
src=WINDY_EMBED
578580
)
579581

580582

config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
CITY_ID: 5403676
2-
TZ: "US/Pacific"
32
DB_HOST: "localhost"
43
DB_PORT: 27017
54
DB_NAME: "wdash"
65
INTERVAL: 1800
76
PORT: 57042
87
# Your api key goes here
98
API_KEY: ""
9+
WINDY_EMBED: "https://embed.windy.com/embed2.html?lat=39.339&lon=-120.173&detailLat=39.339&detailLon=-120.173&width=650&height=450&zoom=5&level=surface&overlay=wind&product=ecmwf&menu=&message=&marker=&calendar=now&pressure=&type=map&location=coordinates&detail=&metricWind=mph&metricTemp=%C2%B0F&radarRange=-1"

daemon.py

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
HOST = CONFIG["DB_HOST"]
1717
PORT = CONFIG["DB_PORT"]
1818
NAME = CONFIG["DB_NAME"]
19-
TZ = CONFIG["TZ"]
2019
INTERVAL = CONFIG["INTERVAL"]
2120
CITY_ID = CONFIG["CITY_ID"]
2221
API_KEY = CONFIG["API_KEY"]
@@ -26,7 +25,6 @@
2625
cf = mc[NAME].weather_forecasted
2726
owm = OWM(API_KEY)
2827
mgr = owm.weather_manager()
29-
TZ_PYTZ = pytz.timezone(TZ)
3028
TIMEOUT_INTERVAL = 60 # seconds
3129
handler = logging.StreamHandler()
3230
formatter = logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)

demo.gif

62.9 MB
Loading

0 commit comments

Comments
 (0)