diff --git a/notebooks/paysage_api_test.ipynb b/notebooks/paysage_api_test.ipynb new file mode 100644 index 0000000..7a60833 --- /dev/null +++ b/notebooks/paysage_api_test.ipynb @@ -0,0 +1,126 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import os\n", + "import requests\n", + "\n", + "import pandas as pd\n", + "from dotenv import load_dotenv\n", + "\n", + "load_dotenv()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "url = \"https://paysage-api.staging.dataesr.ovh/relations?limit=10000&filters[relationTag]=structure-categorie&filters[relatedObjectId]=mCpLW\"\n", + "headers = {\"X-API-KEY\": os.getenv(\"PAYSAGE_API_KEY\")}\n", + "\n", + "response = requests.get(url, headers=headers)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'mCpLW'" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "response.json().get(\"data\")[0].get(\"relatedObjectId\")" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [], + "source": [ + "id = \"m7K6T\"\n", + "url = f\"https://paysage-api.staging.dataesr.ovh/structures/{id}\"\n", + "url = f\"https://paysage-api.staging.dataesr.ovh/relations?limit=100&filters[relationTag]=structure-categorie&filters[resourceId]={id}\"\n", + "headers = {\"X-API-KEY\": os.getenv(\"PAYSAGE_API_KEY\")}\n", + "\n", + "response = requests.get(url, headers=headers)" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'usualNameFr': 'Université',\n", + " 'priority': 1,\n", + " 'id': 'mCpLW',\n", + " 'displayName': 'Université',\n", + " 'collection': 'categories',\n", + " 'href': '/categories/mCpLW',\n", + " 'usualNameEn': None,\n", + " 'descriptionFr': None,\n", + " 'descriptionEn': None}" + ] + }, + "execution_count": 62, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "response.json().get(\"data\")[16].get(\"relatedObject\")" + ] + } + ], + "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.11.5" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/project/client/dist/index.html b/project/client/dist/index.html index 5e90c09..79a8906 100644 --- a/project/client/dist/index.html +++ b/project/client/dist/index.html @@ -6,7 +6,7 @@