|
5 | 5 | "execution_count": null,
|
6 | 6 | "source": [
|
7 | 7 | "import os\n",
|
8 |
| - "os.environ[\"LS_API_KEY\"] = \"MY-API-KEY\" # replace your API key here." |
| 8 | + "\n", |
| 9 | + "os.environ[\"LS_API_KEY\"] = \"MY-API-KEY\" # replace your API key here." |
9 | 10 | ],
|
10 | 11 | "outputs": [],
|
11 | 12 | "metadata": {}
|
|
24 | 25 | "LS_API_KEY = os.environ.get(\"LS_API_KEY\")\n",
|
25 | 26 | "ls = LS(api_key=LS_API_KEY)\n",
|
26 | 27 | "\n",
|
27 |
| - "result1 = ls.get_dest_weather(\n", |
28 |
| - " at=[19.1503, 72.8530],\n", |
29 |
| - " products=[DEST_WEATHER_PRODUCT.observation]\n", |
30 |
| - ")\n", |
| 28 | + "result1 = ls.get_dest_weather(at=[19.1503, 72.8530], products=[DEST_WEATHER_PRODUCT.observation])\n", |
31 | 29 | "\n",
|
32 | 30 | "results = []\n",
|
33 | 31 | "m = Map(\n",
|
|
37 | 35 | ")\n",
|
38 | 36 | "for observation in result1.places[0][\"observations\"]:\n",
|
39 | 37 | " results.append(\n",
|
40 |
| - " dict(\n", |
41 |
| - " lat=observation[\"place\"][\"location\"][\"lat\"],\n", |
42 |
| - " lng=observation[\"place\"][\"location\"][\"lng\"],\n", |
43 |
| - " data=observation[\"description\"] + \" \" + str(observation[\"temperature\"]) + \"C\",\n", |
44 |
| - " )\n", |
| 38 | + " dict(\n", |
| 39 | + " lat=observation[\"place\"][\"location\"][\"lat\"],\n", |
| 40 | + " lng=observation[\"place\"][\"location\"][\"lng\"],\n", |
| 41 | + " data=observation[\"description\"] + \" \" + str(observation[\"temperature\"]) + \"C\",\n", |
45 | 42 | " )\n",
|
| 43 | + " )\n", |
46 | 44 | "\n",
|
47 | 45 | "provider = MarkerCluster(data_points=results, show_bubble=True)\n",
|
48 | 46 | "layer = ObjectLayer(provider=provider)\n",
|
|
60 | 58 | "from datetime import datetime\n",
|
61 | 59 | "\n",
|
62 | 60 | "result2 = ls.get_weather_alerts(\n",
|
63 |
| - " geometry=Point(coordinates=[15.256, 23.456]),\n", |
64 |
| - " start_time=datetime.now(),\n", |
65 |
| - " width=3000,\n", |
66 |
| - " )\n", |
| 61 | + " geometry=Point(coordinates=[15.256, 23.456]),\n", |
| 62 | + " start_time=datetime.now(),\n", |
| 63 | + " width=3000,\n", |
| 64 | + ")\n", |
67 | 65 | "\n",
|
68 | 66 | "print(result2)"
|
69 | 67 | ],
|
|
0 commit comments