{ "cells": [ { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "# general imports\n", "import cmath\n", "import numpy as np\n", "import pandas as pd\n", "import streamlit as st\n", "import requests\n", "import geopandas as gpd\n", "from datetime import date\n", "import groclient\n", "import geopandas as gpd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Gro Intelligence\n", "Gro Intelligence offers many paid tools for analysis of food security related topics. \n", "[Documentation on API here](https://developers.gro-intelligence.com/index.html) " ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "# ToDo - will be easier with more documentation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Famine Early Warning System (FEWS)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "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", " \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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idclassification_scalecollection_datecountry_codedatasourcedocumentdatasourceorganizationis_allowing_for_assistanceperiod_datescenariostart_dateunit_typevaluegeometry
00IPC 3.02022-05-01CM65362026False2022-05-31ML12022-05-01fsc_admin_lhz1POLYGON ((9.88436 2.22968, 9.88184 2.23220, 9....
11IPC 3.02022-05-01CM65362026False2022-05-31ML12022-05-01fsc_admin_lhz2MULTIPOLYGON (((15.13318 4.10569, 15.13798 4.0...
22IPC 3.02022-05-01CM65362026False2022-05-31ML12022-05-01fsc_admin_lhz3MULTIPOLYGON (((9.47588 4.36309, 9.47229 4.363...
33IPC 3.02022-05-01CM65362026False2022-09-30ML22022-06-01fsc_admin_lhz1POLYGON ((9.88436 2.22968, 9.88184 2.23220, 9....
44IPC 3.02022-05-01CM65362026False2022-09-30ML22022-06-01fsc_admin_lhz2MULTIPOLYGON (((9.03586 4.26520, 9.04562 4.263...
55IPC 3.02022-05-01CM65362026False2022-09-30ML22022-06-01fsc_admin_lhz3MULTIPOLYGON (((8.96811 4.30481, 8.96344 4.295...
\n", "
" ], "text/plain": [ " id classification_scale collection_date country_code datasourcedocument \\\n", "0 0 IPC 3.0 2022-05-01 CM 6536 \n", "1 1 IPC 3.0 2022-05-01 CM 6536 \n", "2 2 IPC 3.0 2022-05-01 CM 6536 \n", "3 3 IPC 3.0 2022-05-01 CM 6536 \n", "4 4 IPC 3.0 2022-05-01 CM 6536 \n", "5 5 IPC 3.0 2022-05-01 CM 6536 \n", "\n", " datasourceorganization is_allowing_for_assistance period_date scenario \\\n", "0 2026 False 2022-05-31 ML1 \n", "1 2026 False 2022-05-31 ML1 \n", "2 2026 False 2022-05-31 ML1 \n", "3 2026 False 2022-09-30 ML2 \n", "4 2026 False 2022-09-30 ML2 \n", "5 2026 False 2022-09-30 ML2 \n", "\n", " start_date unit_type value \\\n", "0 2022-05-01 fsc_admin_lhz 1 \n", "1 2022-05-01 fsc_admin_lhz 2 \n", "2 2022-05-01 fsc_admin_lhz 3 \n", "3 2022-06-01 fsc_admin_lhz 1 \n", "4 2022-06-01 fsc_admin_lhz 2 \n", "5 2022-06-01 fsc_admin_lhz 3 \n", "\n", " geometry \n", "0 POLYGON ((9.88436 2.22968, 9.88184 2.23220, 9.... \n", "1 MULTIPOLYGON (((15.13318 4.10569, 15.13798 4.0... \n", "2 MULTIPOLYGON (((9.47588 4.36309, 9.47229 4.363... \n", "3 POLYGON ((9.88436 2.22968, 9.88184 2.23220, 9.... \n", "4 MULTIPOLYGON (((9.03586 4.26520, 9.04562 4.263... \n", "5 MULTIPOLYGON (((8.96811 4.30481, 8.96344 4.295... " ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fews_url = \"https://fdw.fews.net/api/ipcphasemap/?country_code=CM&collection_date=2022-05-01&format=geojson\"\n", "gdf = gpd.read_file(fews_url)\n", "gdf" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "I can't find documentation on the FEWS API and they are not accepting new account submissions\n", "\n", "Find mapbox tileset of data linked in our doc here: \"highestroad.6ph459qs\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "image.png" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.10.4 ('food-security')", "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.10.4" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "80d14d1fb741077bd42a5b4187c7db14fd15f042564cfa5e7db6942dfa41f05d" } } }, "nbformat": 4, "nbformat_minor": 2 }