Unified SQL access to Sudan's humanitarian, development, and geospatial data from 5 international APIs (World Bank, WHO, FAO, UNHCR, ILO)
Installing and Loading
INSTALL sudan FROM community;
LOAD sudan;
Example
-- List all data providers
SELECT * FROM SUDAN_Providers();
-- Sudan population from World Bank
SELECT year, value FROM SUDAN_WorldBank('SP.POP.TOTL')
WHERE year >= 2020 ORDER BY year;
-- Sudan's 18 states with Arabic names
SELECT state_name, state_name_ar, iso_code FROM SUDAN_States();
About sudan
The Sudan extension brings unified SQL access to Sudan's publicly available data across 5 international APIs — World Bank, WHO, FAO, UNHCR, and ILO.
Sudan is experiencing one of the world's largest humanitarian crises, yet its data is scattered across dozens of international APIs with incompatible formats. This extension enables analysts, researchers, and humanitarian workers to query demographics, economics, health, agriculture, displacement, and geospatial boundaries using standard SQL.
Data providers:
- World Bank — Development indicators, GDP, population, education
- WHO — Health indicators, disease burden, mortality rates
- FAO — Agricultural production, food security, land use
- UNHCR — Refugees, IDPs, asylum seekers, displacement data
- ILO — Employment, labor force, unemployment statistics
Key features:
- 12 SQL functions covering data retrieval, indicator search, and geospatial queries
- Bilingual support (Arabic/English) for state names and provider metadata
- Regional comparison with 8 neighboring countries (Egypt, Ethiopia, Chad, South Sudan, Eritrea, Libya, CAF)
- Embedded GeoJSON boundaries for Sudan's 18 states (works offline)
- In-memory response caching for efficient repeated queries
Added Functions
| function_name | function_type | description | comment | examples | |———————-|—————|————-|———|————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————| | SUDAN_Boundaries | table | | NULL | [ – Get all 18 state boundaries SELECT state_name, state_name_ar, iso_code, geojson FROM SUDAN_Boundaries('state');
-- Get country boundary
SELECT * FROM SUDAN_Boundaries('country');
-- Use with spatial extension
SELECT state_name, ST_GeomFromGeoJSON(geojson) AS geom FROM SUDAN_Boundaries('state');
] | | SUDAN_FAO | table | | NULL | [
-- Sudan crop production
SELECT * FROM SUDAN_FAO('QCL', 'production_quantity')
WHERE item = 'Wheat';
-- Compare with neighbors
SELECT * FROM SUDAN_FAO('QCL', 'production_quantity', countries := ['SDN', 'EGY', 'ETH']);
] | | SUDAN_GeoCode | scalar | | NULL | [
SELECT SUDAN_GeoCode('Khartoum'); -- returns 'SD-KH'
SELECT SUDAN_GeoCode('الخرطوم'); -- returns 'SD-KH'
] | | SUDAN_ILO | table | | NULL | [
-- Unemployment rate
SELECT * FROM SUDAN_ILO('UNE_DEAP_SEX_AGE_RT');
-- Compare with neighbors
SELECT * FROM SUDAN_ILO('UNE_DEAP_SEX_AGE_RT', countries := ['SDN', 'EGY']);
] | | SUDAN_Providers | table | | NULL | [
SELECT provider_id, name, description FROM SUDAN_Providers();
+-----------+-----------------------------+----------------------------------------------+
|provider_id| name | description |
+-----------+-----------------------------+----------------------------------------------+
| worldbank | World Bank | World Development Indicators and other ... |
| who | World Health Organization | Global Health Observatory (GHO) data |
| fao | Food and Agriculture Org... | FAOSTAT agricultural statistics |
| unhcr | UNHCR | UN Refugee Agency displacement and pop... |
| ilo | International Labour Org... | International Labour Organization statistics |
+-----------+-----------------------------+----------------------------------------------+
] | | SUDAN_Search | table | | NULL | [
SELECT * FROM SUDAN_Search(query := 'maternal mortality');
+-----------+-----------------+------------------------------------------+
| provider | indicator_id | indicator_name |
+-----------+-----------------+------------------------------------------+
| worldbank | SH.STA.MMRT | Maternal mortality ratio (per 100,000) |
| who | MDG_0000000025 | Maternal mortality ratio (per 100 000) |
+-----------+-----------------+------------------------------------------+
] | | SUDAN_States | table | | NULL | [
SELECT state_name, state_name_ar, iso_code FROM SUDAN_States();
+------------------+------------------+---------+
| state_name | state_name_ar | iso_code|
+------------------+------------------+---------+
| Khartoum | الخرطوم | SD-KH |
| Al Jazirah | الجزيرة | SD-GZ |
| ... | ... | ... |
+------------------+------------------+---------+
] | | SUDAN_UNHCR | table | | NULL | [
-- UNHCR displacement data for Sudan
SELECT * FROM SUDAN_UNHCR('idps');
-- Compare Sudan and South Sudan refugee data
SELECT * FROM SUDAN_UNHCR('refugees', countries := ['SDN', 'SSD']);
] | | SUDAN_WB_Indicators | table | | NULL | [
-- List all indicators
SELECT * FROM SUDAN_WB_Indicators() LIMIT 10;
-- Search for population indicators
SELECT * FROM SUDAN_WB_Indicators(search := 'population');
+-----------------+------------------------------+----------------------------+
| indicator_id | indicator_name | source |
+-----------------+------------------------------+----------------------------+
| SP.POP.TOTL | Population, total | World Development Indicators|
| SP.POP.GROW | Population growth (annual %) | World Development Indicators|
+-----------------+------------------------------+----------------------------+
] | | SUDAN_WHO | table | | NULL | [
-- Life expectancy at birth
SELECT * FROM SUDAN_WHO('WHOSIS_000001') WHERE year >= 2015;
-- Compare Sudan and South Sudan
SELECT * FROM SUDAN_WHO('WHOSIS_000001', countries := ['SDN', 'SSD']);
] | | SUDAN_WHO_Indicators | table | | NULL | [
SELECT * FROM SUDAN_WHO_Indicators(search := 'mortality') LIMIT 5;
] | | SUDAN_WorldBank | table | | NULL | [
-- Sudan population over time
SELECT * FROM SUDAN_WorldBank('SP.POP.TOTL');
-- Compare Sudan with Egypt and South Sudan
SELECT * FROM SUDAN_WorldBank('SP.POP.TOTL', countries := ['SDN', 'EGY', 'SSD'])
WHERE year >= 2010 AND year <= 2023;
+---------------+------------------+---------+--------------+------+-----------+
| indicator_id | indicator_name | country | country_name | year | value |
+---------------+------------------+---------+--------------+------+-----------+
| SP.POP.TOTL | Population, total| SD | Sudan | 2023 | 48109006 |
+---------------+------------------+---------+--------------+------+-----------+
] |