diff --git a/notebooks/notebook_current_data.ipynb b/notebooks/notebook_current_data.ipynb index d2d01a9..b9ec2d0 100644 --- a/notebooks/notebook_current_data.ipynb +++ b/notebooks/notebook_current_data.ipynb @@ -19,9 +19,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/hanne/Documents/anvendt prosjekt/anvendt_mappe/venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020\n", + " warnings.warn(\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Data fetch: ok\n" + ] + } + ], "source": [ "import sys\n", "import os\n", @@ -51,15 +67,23 @@ "Skriv inn navn for til filen du vil lagre med dataen.\n", "\n", "Eks. test\n", - "Da vil filen lagres som data_**test**.json, i mappen \"../data/output_stedsnavn/data_{filnavn}.json\"\n", + "Da vil filen lagres som data_**test**.json, i mappen \"../data/output_current/data_{filnavn}.json\"\n", "\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Data has been written to /Users/hanne/Documents/anvendt prosjekt/anvendt_mappe/data/../data/output_current_data/data_ttggs.json\n" + ] + } + ], "source": [ "# Gets the absolute path to the src folder\n", "sys.path.append(os.path.abspath(\"../src\"))\n", @@ -84,9 +108,45 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "{'coord': {'lon': 10.7461, 'lat': 59.9127},\n", + " 'weather': [{'id': 800,\n", + " 'main': 'Clear',\n", + " 'description': 'clear sky',\n", + " 'icon': '01d'}],\n", + " 'base': 'stations',\n", + " 'main': {'temp': 15.97,\n", + " 'feels_like': 14.48,\n", + " 'temp_min': 13.64,\n", + " 'temp_max': 16.09,\n", + " 'pressure': 1017,\n", + " 'humidity': 33,\n", + " 'sea_level': 1017,\n", + " 'grnd_level': 993},\n", + " 'visibility': 10000,\n", + " 'wind': {'speed': 2.68, 'deg': 200, 'gust': 4.47},\n", + " 'clouds': {'all': 5},\n", + " 'dt': 1746536672,\n", + " 'sys': {'type': 2,\n", + " 'id': 46775,\n", + " 'country': 'NO',\n", + " 'sunrise': 1746500507,\n", + " 'sunset': 1746559526},\n", + " 'timezone': 7200,\n", + " 'id': 3143244,\n", + " 'name': 'Oslo',\n", + " 'cod': 200}" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "import json\n", "\n", @@ -119,9 +179,104 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
namemain.tempmain.feels_likemain.pressuremain.humiditymain.sea_levelmain.grnd_levelwind.speedwind.gustclouds.allsys.countrysys.sunrisesys.sunset
dt
2025-05-06 13:04:32Oslo15.9714.4810173310179932.684.475NO2025-05-06 03:01:472025-05-06 19:25:26
\n", + "
" + ], + "text/plain": [ + " name main.temp main.feels_like main.pressure \\\n", + "dt \n", + "2025-05-06 13:04:32 Oslo 15.97 14.48 1017 \n", + "\n", + " main.humidity main.sea_level main.grnd_level \\\n", + "dt \n", + "2025-05-06 13:04:32 33 1017 993 \n", + "\n", + " wind.speed wind.gust clouds.all sys.country \\\n", + "dt \n", + "2025-05-06 13:04:32 2.68 4.47 5 NO \n", + "\n", + " sys.sunrise sys.sunset \n", + "dt \n", + "2025-05-06 13:04:32 2025-05-06 03:01:47 2025-05-06 19:25:26 " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "import pandas as pd\n", "\n", @@ -178,7 +333,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.5" + "version": "3.9.6" } }, "nbformat": 4,