diff --git a/labs/2021/03-mvc/solucoes/danibouw/README.md b/labs/2021/03-mvc/solucoes/danibouw/README.md index 4b4a9e174..b1a7e8b8c 100644 --- a/labs/2021/03-mvc/solucoes/danibouw/README.md +++ b/labs/2021/03-mvc/solucoes/danibouw/README.md @@ -15,15 +15,30 @@ Estrutura de pastas: # Tarefa 1 - App no MIT App Inventor -> Coloque as imagens PNG da captura de seis telas do seu aplicativo: -> * tela 1 - captura da tela completa de design de interface -> * tela 2 - captura de tela do app com nenhum produto selecionado -> * tela 3 - captura de tela do app com primeiro produto selecionado -> * tela 4 - captura de tela do app com segundo produto selecionado -> * tela 5 - compra de um dos produtos efetivada -> * tela 6 - diagrama de blocos do aplicativo -> -> Coloque um link para o arquivo do aplicativo exportado a partir do MIT App Inventor em formato `aia`. Ele estará dentro da pasta `app`. +* tela 1 - captura da tela completa de design de interface: +![Diagrama Eventos](images/app1.png) + + +* tela 2 - captura de tela do app com nenhum produto selecionado: +![Diagrama Eventos](images/app2.png) + + +* tela 3 - captura de tela do app com primeiro produto selecionado: +![Diagrama Eventos](images/app3.png) + + +* tela 4 - captura de tela do app com segundo produto selecionado: +![Diagrama Eventos](images/app4.png) + + +* tela 5 - compra de um dos produtos efetivada: +![Diagrama Eventos](images/app5.png) + + +* tela 6 - diagrama de blocos do aplicativo: +![Diagrama Eventos](images/app7.png) + +[Link App](./app/inf331_interface_de_compra.aia) # Tarefa 2 - Diagrama de Componentes dirigida a Eventos diff --git a/labs/2021/03-mvc/solucoes/danibouw/app/inf331_interface_de_compra.aia b/labs/2021/03-mvc/solucoes/danibouw/app/inf331_interface_de_compra.aia new file mode 100644 index 000000000..a4506b73b Binary files /dev/null and b/labs/2021/03-mvc/solucoes/danibouw/app/inf331_interface_de_compra.aia differ diff --git a/labs/2021/03-mvc/solucoes/danibouw/images/app1.png b/labs/2021/03-mvc/solucoes/danibouw/images/app1.png new file mode 100644 index 000000000..2bfc9983f Binary files /dev/null and b/labs/2021/03-mvc/solucoes/danibouw/images/app1.png differ diff --git a/labs/2021/05-services/solucoes/danibouw/README.md b/labs/2021/05-services/solucoes/danibouw/README.md new file mode 100644 index 000000000..30b78e15d --- /dev/null +++ b/labs/2021/05-services/solucoes/danibouw/README.md @@ -0,0 +1,27 @@ +# Modelo para Apresentação do Lab05 - Composição, Serviços e REST + +Estrutura de pastas: + +~~~ +├── README.md <- arquivo apresentando a tarefa +│ +└── images <- arquivos de imagens usadas no documento +│ +└── notebook <- arquivo do notebook +~~~ + +# Aluno +* Daniela Bouwman Codeceira + +# Bloco 1 - Diagramas relacionados com Leilão Invertido + +* diagrama 1 - componentes e barramento +![Diagrama1](images/Auction1.png) +* diagrama 2 - interface +![Diagrama2](images/Auction2.png) +* diagrama 3 - mensagens +![Diagrama1](images/Auction3.png) + +# Bloco 2 - Acesso REST via Jupyter + +[Link Notebook](/notebook/lab5-tarefas.ipynb) diff --git a/labs/2021/05-services/solucoes/danibouw/images/Auction1.png b/labs/2021/05-services/solucoes/danibouw/images/Auction1.png new file mode 100644 index 000000000..930450bd6 Binary files /dev/null and b/labs/2021/05-services/solucoes/danibouw/images/Auction1.png differ diff --git a/labs/2021/05-services/solucoes/danibouw/images/Auction2.png b/labs/2021/05-services/solucoes/danibouw/images/Auction2.png new file mode 100644 index 000000000..3f5bc4f53 Binary files /dev/null and b/labs/2021/05-services/solucoes/danibouw/images/Auction2.png differ diff --git a/labs/2021/05-services/solucoes/danibouw/images/Auction3.png b/labs/2021/05-services/solucoes/danibouw/images/Auction3.png new file mode 100644 index 000000000..192cffe9b Binary files /dev/null and b/labs/2021/05-services/solucoes/danibouw/images/Auction3.png differ diff --git a/labs/2021/05-services/solucoes/danibouw/notebook/lab5-tarefas.ipynb b/labs/2021/05-services/solucoes/danibouw/notebook/lab5-tarefas.ipynb new file mode 100644 index 000000000..4a86a19c7 --- /dev/null +++ b/labs/2021/05-services/solucoes/danibouw/notebook/lab5-tarefas.ipynb @@ -0,0 +1,558 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "monetary-oakland", + "metadata": {}, + "source": [ + "# Laboratório 5 - Bloco 2\n", + "\n", + "Nas tarefas a seguir o número de células de resposta pode ser aumentado conforme a necessidade." + ] + }, + { + "cell_type": "markdown", + "id": "bridal-netscape", + "metadata": {}, + "source": [ + "## Tarefa 1\n", + "\n", + "### Carregue o nó de Tenda dos Milagres (da versão em inglês Tent of Miracles) em Python e mostre o conteúdo JSON." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "exciting-cement", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\n", + " \"d\": {\n", + " \"results\": [\n", + " {\n", + " \"__metadata\": {\n", + " \"uri\": \"http://dbpedia.org/resource/Tent_of_Miracles_(novel)\"\n", + " },\n", + " \"http://www.w3.org/2000/01/rdf-schema#label\": \"Tent of Miracles (novel)\",\n", + " \"http://dbpedia.org/ontology/wikiPageWikiLink\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/resource/French_New_Wave\"\n", + " }\n", + " },\n", + " \"http://purl.org/dc/terms/subject\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/resource/Category:Modernist_novels\"\n", + " }\n", + " },\n", + " \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/ontology/WrittenWork\"\n", + " }\n", + " },\n", + " \"http://dbpedia.org/property/wikiPageUsesTemplate\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/resource/Template:According_to_whom\"\n", + " }\n", + " },\n", + " \"http://www.w3.org/2000/01/rdf-schema#comment\": \"Tent of Miracles (Portuguese: Tenda dos Milagres) is a Brazilian Modernist novel. It was written by Jorge Amado in 1967 and published the following year. It was later adapted to a 1977 Cinema Novo (Nouvelle Vague) film by director/screenplay writer Nelson Pereira dos Santos.\",\n", + " \"http://dbpedia.org/ontology/abstract\": \"La bottega dei miracoli \\u00e8 un romanzo di Jorge Amado pubblicato nel 1960. Come altri romanzi dell'autore (ad esempio Tieta d'Agreste e Teresa Batista) \\u00e8 un testo composito, con un intreccio zigzagante fra analessi e prolessi, con mutamenti di voci narranti ed inserti di materiale eterogeneo.\\u00c8 possibile che l'evento scatenante del racconto (la visita del famoso scienziato) sia stato ispirato dall'esperienza vissuta; in quello stesso 1960, infatti, Jean Paul Sartre e Simone De Beauvoir visitarono il Brasile su invito dello stesso Amado: la visita divenne un evento mediatico, celebrato in numerose manifestazioni istituzionali.\",\n", + " \"http://dbpedia.org/property/pubDate\": \"1969\",\n", + " \"http://dbpedia.org/property/country\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/resource/Brazil\"\n", + " }\n", + " },\n", + " \"http://www.w3.org/2002/07/owl#sameAs\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://rdf.freebase.com/ns/m.02xrs4\"\n", + " }\n", + " },\n", + " \"http://dbpedia.org/ontology/wikiPageRevisionID\": \"974212123\",\n", + " \"http://dbpedia.org/property/author\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/resource/Jorge_Amado\"\n", + " }\n", + " },\n", + " \"http://dbpedia.org/ontology/author\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/resource/Jorge_Amado\"\n", + " }\n", + " },\n", + " \"http://xmlns.com/foaf/0.1/name\": \"Tenda dos Milagres\",\n", + " \"http://dbpedia.org/property/englishPubDate\": \"1971\",\n", + " \"http://dbpedia.org/ontology/country\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/resource/Brazil\"\n", + " }\n", + " },\n", + " \"http://dbpedia.org/property/name\": \"Tent of Miracles\",\n", + " \"http://purl.org/linguistics/gold/hypernym\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/resource/Novel\"\n", + " }\n", + " },\n", + " \"http://dbpedia.org/property/titleOrig\": \"Tenda dos Milagres\",\n", + " \"http://dbpedia.org/ontology/publisher\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/resource/Brazil\"\n", + " }\n", + " },\n", + " \"http://dbpedia.org/ontology/language\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/resource/Portuguese_language\"\n", + " }\n", + " },\n", + " \"http://www.w3.org/ns/prov#wasDerivedFrom\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://en.wikipedia.org/wiki/Tent_of_Miracles_(novel)?oldid=974212123&ns=0\"\n", + " }\n", + " },\n", + " \"http://dbpedia.org/ontology/wikiPageLength\": \"5253\",\n", + " \"http://purl.org/dc/elements/1.1/publisher\": \"Martins, Sao Paulo, Brazil\",\n", + " \"http://dbpedia.org/property/language\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://dbpedia.org/resource/Portuguese_language\"\n", + " }\n", + " },\n", + " \"http://dbpedia.org/ontology/wikiPageID\": \"623351\",\n", + " \"http://dbpedia.org/property/publisher\": \"Martins, Sao Paulo, Brazil\",\n", + " \"http://dbpedia.org/property/caption\": \"First edition\",\n", + " \"http://xmlns.com/foaf/0.1/isPrimaryTopicOf\": {\n", + " \"__deferred\": {\n", + " \"uri\": \"http://en.wikipedia.org/wiki/Tent_of_Miracles_(novel)\"\n", + " }\n", + " }\n", + " }\n", + " ],\n", + " \"__count\": \"1\"\n", + " }\n", + "}\n" + ] + } + ], + "source": [ + "import io\n", + "import requests\n", + "import json\n", + "\n", + "url_drum = \"http://dbpedia.org/data/Tent_of_Miracles_(novel).jsod\"\n", + "\n", + "data_drum = requests.get(url_drum)\n", + "json_drum = data_drum.json()\n", + "\n", + "print(json.dumps(json_drum, indent=3))" + ] + }, + { + "cell_type": "markdown", + "id": "threatened-shepherd", + "metadata": {}, + "source": [ + "## Tarefa 2\n", + "### Recupere via Python e mostre o autor de Tenda dos Milagres?" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "subjective-bachelor", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Autor de tendas dos Milagres: http://dbpedia.org/resource/Jorge_Amado\n" + ] + } + ], + "source": [ + "grass = json_drum[\"d\"][\"results\"][0][\"http://dbpedia.org/ontology/author\"][\"__deferred\"][\"uri\"]\n", + "print(\"Autor de tendas dos Milagres: \" + grass)" + ] + }, + { + "cell_type": "markdown", + "id": "specialized-playback", + "metadata": {}, + "source": [ + "## Tarefa 3\n", + "### Quais os termos usados para Aspirina (consulta JSON/MeSH em Python)?" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "about-sacramento", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/D001241\",\n", + " \"label\": \"Aspirin\"\n", + " }\n", + "]\n", + "uri do recurso: http://id.nlm.nih.gov/mesh/D001241\n", + "código do recurso: D001241\n", + "{\n", + " \"descriptor\": \"http://id.nlm.nih.gov/mesh/D001241\",\n", + " \"terms\": [\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003713\",\n", + " \"label\": \"Aspirin\",\n", + " \"preferred\": true\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003714\",\n", + " \"label\": \"2-(Acetyloxy)benzoic Acid\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003712\",\n", + " \"label\": \"Acetylsalicylic Acid\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003721\",\n", + " \"label\": \"Acetysal\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003722\",\n", + " \"label\": \"Acylpyrin\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003711\",\n", + " \"label\": \"Aloxiprimum\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003723\",\n", + " \"label\": \"Colfarit\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003715\",\n", + " \"label\": \"Dispril\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003719\",\n", + " \"label\": \"Easprin\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003724\",\n", + " \"label\": \"Ecotrin\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003725\",\n", + " \"label\": \"Endosprin\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003726\",\n", + " \"label\": \"Magnecyl\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003727\",\n", + " \"label\": \"Micristin\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003717\",\n", + " \"label\": \"Polopirin\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003728\",\n", + " \"label\": \"Polopiryna\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003716\",\n", + " \"label\": \"Solprin\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003718\",\n", + " \"label\": \"Solupsan\",\n", + " \"preferred\": false\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/T003720\",\n", + " \"label\": \"Zorprin\",\n", + " \"preferred\": false\n", + " }\n", + " ],\n", + " \"qualifiers\": [\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000008\",\n", + " \"label\": \"administration & dosage\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000009\",\n", + " \"label\": \"adverse effects\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000819\",\n", + " \"label\": \"agonists\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000031\",\n", + " \"label\": \"analogs & derivatives\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000032\",\n", + " \"label\": \"analysis\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000037\",\n", + " \"label\": \"antagonists & inhibitors\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000097\",\n", + " \"label\": \"blood\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000134\",\n", + " \"label\": \"cerebrospinal fluid\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000138\",\n", + " \"label\": \"chemical synthesis\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000737\",\n", + " \"label\": \"chemistry\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000145\",\n", + " \"label\": \"classification\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000191\",\n", + " \"label\": \"economics\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000266\",\n", + " \"label\": \"history\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000276\",\n", + " \"label\": \"immunology\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000302\",\n", + " \"label\": \"isolation & purification\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000378\",\n", + " \"label\": \"metabolism\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000493\",\n", + " \"label\": \"pharmacokinetics\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000494\",\n", + " \"label\": \"pharmacology\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000506\",\n", + " \"label\": \"poisoning\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000528\",\n", + " \"label\": \"radiation effects\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000592\",\n", + " \"label\": \"standards\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000600\",\n", + " \"label\": \"supply & distribution\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000627\",\n", + " \"label\": \"therapeutic use\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000633\",\n", + " \"label\": \"toxicity\"\n", + " },\n", + " {\n", + " \"resource\": \"http://id.nlm.nih.gov/mesh/Q000652\",\n", + " \"label\": \"urine\"\n", + " }\n", + " ],\n", + " \"seealso\": []\n", + "}\n" + ] + } + ], + "source": [ + "url_template = \"https://id.nlm.nih.gov/mesh/lookup/descriptor?label={concept}&match={match}&limit={limit}\"\n", + "\n", + "concept = \"Aspirin\"\n", + "match = \"exact\"\n", + "limit = \"10\"\n", + "\n", + "concept = concept.replace(\" \", \"%20\")\n", + "\n", + "url = url_template.replace(\"{concept}\", concept)\\\n", + " .replace(\"{match}\", match)\\\n", + " .replace(\"{limit}\", limit)\n", + "\n", + "data = requests.get(url)\n", + "json_mi = data.json()\n", + "\n", + "print(json.dumps(json_mi, indent=3))\n", + "uri_mesh = json_mi[0][\"resource\"]\n", + "\n", + "print(\"uri do recurso: \" + uri_mesh)\n", + "bar = str.rindex(uri_mesh, \"/\")\n", + "print(\"código do recurso: \" + uri_mesh[bar+1:])\n", + "\n", + "url_template = \"https://id.nlm.nih.gov/mesh/lookup/details?descriptor={code}\"\n", + "\n", + "code = uri_mesh[bar+1:]\n", + "\n", + "url = url_template.replace(\"{code}\", code)\n", + "\n", + "data = requests.get(url)\n", + "json_mid = data.json()\n", + "print(json.dumps(json_mid, indent=3))" + ] + }, + { + "cell_type": "markdown", + "id": "uniform-worst", + "metadata": {}, + "source": [ + "## Tarefa 4\n", + "### Escolha algum lugar no OpenStreetMap e elabore a mesma sequência de três chamadas de serviços para o seu conceito." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "virgin-volunteer", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\n", + " {\n", + " \"place_id\": 98668927,\n", + " \"licence\": \"Data \\u00a9 OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\n", + " \"osm_type\": \"way\",\n", + " \"osm_id\": 34633854,\n", + " \"boundingbox\": [\n", + " \"40.7479226\",\n", + " \"40.7489422\",\n", + " \"-73.9864855\",\n", + " \"-73.9848259\"\n", + " ],\n", + " \"lat\": \"40.748428399999995\",\n", + " \"lon\": \"-73.98565461987332\",\n", + " \"display_name\": \"Empire State Building, 350, 5th Avenue, Koreatown, Midtown South, Manhattan, New York County, New York, 10018, United States\",\n", + " \"class\": \"tourism\",\n", + " \"type\": \"attraction\",\n", + " \"importance\": 0.8515868466874569,\n", + " \"icon\": \"https://nominatim.openstreetmap.org/ui/mapicons//poi_point_of_interest.p.20.png\"\n", + " },\n", + " {\n", + " \"place_id\": 61949444,\n", + " \"licence\": \"Data \\u00a9 OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\n", + " \"osm_type\": \"node\",\n", + " \"osm_id\": 5552887205,\n", + " \"boundingbox\": [\n", + " \"52.2956835\",\n", + " \"52.2957835\",\n", + " \"16.7553074\",\n", + " \"16.7554074\"\n", + " ],\n", + " \"lat\": \"52.2957335\",\n", + " \"lon\": \"16.7553574\",\n", + " \"display_name\": \"Empire State Building, Pozna\\u0144ska, Trzebaw, gmina St\\u0119szew, powiat pozna\\u0144ski, wojew\\u00f3dztwo wielkopolskie, Polska\",\n", + " \"class\": \"tourism\",\n", + " \"type\": \"artwork\",\n", + " \"importance\": 0.30100000000000005,\n", + " \"icon\": \"https://nominatim.openstreetmap.org/ui/mapicons//tourist_art_gallery2.p.20.png\"\n", + " }\n", + "]\n" + ] + } + ], + "source": [ + "url_template = \"http://nominatim.openstreetmap.org/search?format={format}&q={query}\"\n", + "format = \"json\"\n", + "query = \"Empire State Building\"\n", + "\n", + "url = url_template.replace(\"{format}\", format)\\\n", + " .replace(\"{query}\", query)\n", + "\n", + "data = requests.get(url)\n", + "monument_ref = data.json()\n", + "print(json.dumps(monument_ref, indent=3))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e6faf1e2", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.10" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": false, + "sideBar": false, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": false, + "toc_window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}