FAO Agriculture Integration Plan¶
This guide defines the next FAO integrations that fit AquaScope best and turns them into a concrete implementation plan for this repository.
The intent is to keep AquaScope focused on water intelligence across scales: country water use, basin hydrology, and field-scale irrigation demand.
Current Baseline¶
The repository already contains the core building blocks for an FAO-aligned agriculture vertical:
aquascope.collectors.aquastat.AquastatCollectoraquascope.collectors.wapor.WaPORCollectoraquascope.agriFAO-56 evapotranspiration, crop water demand, and soil water balance toolsaquascope.schemas.agriculturefor AQUASTAT and ET-oriented records
What is still missing is productization:
- full CLI exposure for FAO sources
- a workflow that connects FAO data to the agriculture module end to end
- a clear schema strategy for WaPOR outputs beyond reference ET
- examples and contributor guidance for agricultural workflows
Recommended FAO Targets¶
The next integrations should stay within three FAO-aligned targets. Two are already partially present in the codebase and should be completed first.
1. AQUASTAT via FAOSTAT API¶
Status: already scaffolded in AquastatCollector
Endpoint family to support now
GET /en/data/AQUASTAT
Parameters already aligned with the current collector
area— ISO3 country code orallelement— AQUASTAT variable IDsyear— year or year rangeoutput_type=objects
Priority AQUASTAT variables
4263— Total water withdrawal4253— Agricultural water withdrawal4254— Industrial water withdrawal4255— Municipal water withdrawal4192— Total renewable water resources4312— Total area equipped for irrigation
What AquaScope should produce
- existing
AquastatRecordobjects for raw normalized ingest - country-year time series for water use benchmarking
- irrigation intensity indicators such as agricultural withdrawal per irrigated area
- cross-country comparison tables ready for
recommend,eda, and reporting
Why this is next
AQUASTAT gives AquaScope a national and policy layer that complements the existing hydrology and field-scale agriculture modules.
2. WaPOR v3 API for evapotranspiration and productivity¶
Status: partially scaffolded in WaPORCollector
Verified access pattern already used in the repo
GET /catalog/workspaces/WAPOR-3/cubes/{cube_code}
Key query inputs already reflected in the collector
startDateendDatebbox
Priority cube codes
RET— Reference evapotranspirationAETI— Actual evapotranspiration and interceptionNPP— Net primary production
What AquaScope should produce
- existing
ETReferencerecords forRET - generic WaPOR observations for cube summaries and time series
- area-of-interest ET summaries suitable for irrigation planning
- biomass or productivity indicators for later water-productivity workflows
Why this is next
WaPOR is the field and district layer that bridges climate inputs to crop water planning. It is the strongest FAO complement to the existing FAO-56 code.
3. FAO-56 workflow orchestration on top of FAO data¶
Status: already implemented at the function level in aquascope.agri
No new external endpoint required
This step is not about adding another FAO API first. It is about operationally combining:
- WaPOR ET inputs
- Open-Meteo weather and precipitation
- AquaScope FAO-56 crop coefficient logic
- soil water balance and irrigation scheduling
What AquaScope should produce
- crop water requirement tables by day and growth stage
- irrigation schedules with net and gross water demand
- auto-irrigation recommendations for a field or district
- explainable outputs for researchers and extension teams
Not Recommended Yet¶
Do not expand into broad FAOSTAT agriculture domains before the above is stable. In particular, avoid pulling in many crop, trade, or livestock domains until AquaScope has a crisp water-agriculture product story.
The right order is:
- finish AQUASTAT and WaPOR user flows
- connect them to the FAO-56 module
- only then add broader FAO productivity or food-system comparisons
Proposed Schema Plan¶
The existing schema layer is a good start. The next additions should stay small and explicit.
Keep as-is¶
AquastatRecordETReferenceCropWaterRequirementIrrigationDemandSoilWaterStatus
Add next¶
WaPORObservation¶
Use for cube summaries and AOI time-series values when the output is not only reference ET.
Recommended fields:
source: str = "WAPOR"cube_code: strcube_label: str | Nonedate: date | Nonestart_date: date | Noneend_date: date | Nonebbox: tuple[float, float, float, float] | Nonevalue: floatunit: str | Nonestatistic: str | Noneaoi_id: str | Nonelevel: str | None
CropWaterPlan¶
Use as the aggregate result of a full irrigation-planning workflow.
Recommended fields:
crop: strlocation_name: str | Nonestart_date: dateend_date: datetotal_eto_mm: floattotal_etc_mm: floattotal_effective_rain_mm: floattotal_net_irrigation_mm: floattotal_gross_irrigation_mm: floatdays_triggered: intmethod: str
WaterProductivityRecord¶
Reserve for the first combined AQUASTAT + WaPOR productivity workflow.
Recommended fields:
location_id: stryear: int | Noneperiod_label: str | Noneaeti_mm: float | Nonenpp_value: float | Noneagricultural_withdrawal_m3: float | Noneirrigated_area_ha: float | Noneproductivity_per_water: float | None
Proposed CLI Plan¶
The current collect command should expose the FAO collectors first. After
that, AquaScope should add a dedicated agriculture command group.
Phase 1: expose current FAO collectors¶
aquascope collect --source aquastat \
--country EGY \
--variables 4263,4253,4312 \
--start-year 2010 \
--end-year 2023
aquascope collect --source wapor \
--bbox 30.50,29.80,31.10,30.20 \
--variable RET \
--start-date 2024-04-01 \
--end-date 2024-06-30
Phase 2: add agriculture workflow commands¶
aquascope agri eto --weather-file weather.csv --method penman_monteith
aquascope agri demand \
--crop maize \
--eto-file eto.csv \
--precip-file precip.csv \
--planting-date 2026-04-01
aquascope agri balance \
--crop maize \
--eto-file eto.csv \
--precip-file precip.csv \
--soil-fc 0.30 \
--soil-wp 0.15 \
--root-depth 1.0
aquascope agri benchmark \
--aquastat-file data/raw/aquastat_20260401.json \
--metric agricultural_withdrawal_per_irrigated_area
Phase 3: add end-to-end FAO planning command¶
aquascope agri plan \
--crop maize \
--lat 29.95 \
--lon 31.25 \
--planting-date 2026-04-01 \
--source wapor+openmeteo \
--soil-fc 0.30 \
--soil-wp 0.15 \
--root-depth 1.0
This command should orchestrate data retrieval, ET estimation, crop water requirement calculation, soil-water balance, and irrigation guidance.
Prioritized Implementation Plan¶
Phase 0. Surface What Already Exists¶
Goal: make the current FAO work reachable and trustworthy.
Repository changes:
- expose
aquastatandwaporinaquascope/cli.py - add source entries in
list-sources - add smoke tests for CLI source parity
- add a FAO example script under
examples/ - update
README.mdand docs links
Expected output:
- users can collect FAO data without importing collectors manually
- docs match the package surface
Phase 1. Productize AQUASTAT Country Benchmarking¶
Goal: support country-scale water and irrigation benchmarking.
Touch points:
aquascope/collectors/aquastat.pyaquascope/schemas/agriculture.pyaquascope/analysis/eda.pyaquascope/reporting/tests/test_agri/
Deliverables:
- reliable
AquastatCollector.collect()workflow - helper analysis functions for country-year indicators
- benchmark-ready report tables
Primary output objects:
AquastatRecord- derived benchmark DataFrames
Phase 2. Productize WaPOR AOI Time-Series Support¶
Goal: move WaPOR from basic cube access to usable ET time series.
Touch points:
aquascope/collectors/wapor.pyaquascope/schemas/agriculture.pyaquascope/utils/storage.pytests/test_agri/
Deliverables:
- support for AOI-oriented time-series outputs
- better normalization for
RET,AETI, andNPP - optional metadata discovery helpers for cube definitions
Primary output objects:
ETReferenceWaPORObservation
Phase 3. Add a Flagship Irrigation Planning Workflow¶
Goal: make agriculture a real end-user workflow instead of a set of low-level functions.
Recommended new module:
aquascope/agri/planner.py
Recommended public function:
plan_irrigation(
crop: str,
planting_date: date,
eto_series: pd.Series,
precip_series: pd.Series,
soil: SoilProperties,
efficiency: float = 0.7,
) -> CropWaterPlan
Deliverables:
- workflow wrapper around
crop_water_requirement,irrigation_schedule, andSoilWaterBalance - summarized plan outputs for reporting and dashboards
- simple explainable inputs and outputs for non-programmer users
Primary output objects:
CropWaterPlanIrrigationDemandSoilWaterStatus
Phase 4. Add Water Productivity Benchmarking¶
Goal: connect national water policy and field-scale productivity.
Inputs:
- AQUASTAT agricultural withdrawal
- AQUASTAT irrigated area
- WaPOR
AETI - WaPOR
NPP
Recommended new module:
aquascope/agri/productivity.py
Primary output objects:
WaterProductivityRecord
This phase is where AquaScope becomes distinct from a generic hydrology toolkit.
Example Workflows¶
The examples below are the recommended user journeys to build next.
Workflow A. Country Irrigation Benchmarking¶
Question: which countries are using the most agricultural water relative to their irrigated area?
Proposed command flow:
aquascope collect --source aquastat \
--country all \
--variables 4253,4312 \
--start-year 2015 \
--end-year 2023 \
--format json
aquascope agri benchmark \
--aquastat-file data/raw/aquastat_latest.json \
--metric agricultural_withdrawal_per_irrigated_area
Expected outputs:
- ranked country table
- trend lines by country
- report section for policy comparison
Workflow B. Field or District Irrigation Demand¶
Question: how much irrigation water is needed for maize during the current season in a target area?
Proposed command flow:
aquascope collect --source wapor \
--bbox 30.50,29.80,31.10,30.20 \
--variable RET \
--start-date 2026-04-01 \
--end-date 2026-07-31
aquascope collect --source openmeteo \
--mode weather \
--lat 29.95 \
--lon 31.25 \
--start-date 2026-04-01 \
--end-date 2026-07-31
aquascope agri plan \
--crop maize \
--planting-date 2026-04-01 \
--eto-file data/raw/wapor_ret_latest.json \
--precip-file data/raw/openmeteo_latest.json \
--soil-fc 0.30 \
--soil-wp 0.15 \
--root-depth 1.0
Expected outputs:
- daily ET and ETc table
- irrigation trigger dates
- total net and gross demand for the season
Workflow C. Water Productivity Comparison¶
Question: where is agricultural water converted to biomass most efficiently?
Proposed command flow:
aquascope collect --source aquastat \
--country EGY \
--variables 4253,4312 \
--start-year 2018 \
--end-year 2023
aquascope collect --source wapor \
--bbox 30.50,29.80,31.10,30.20 \
--variable AETI \
--start-date 2023-01-01 \
--end-date 2023-12-31
aquascope collect --source wapor \
--bbox 30.50,29.80,31.10,30.20 \
--variable NPP \
--start-date 2023-01-01 \
--end-date 2023-12-31
aquascope agri productivity \
--aquastat-file data/raw/aquastat_latest.json \
--aeti-file data/raw/wapor_aeti_latest.json \
--npp-file data/raw/wapor_npp_latest.json
Expected outputs:
- biomass-per-water indicators
- region or country benchmark charts
- combined policy plus biophysical productivity report
Immediate Recommendation¶
If only one agriculture feature is implemented next, it should be this:
- expose
aquastatandwaporin the CLI - add
aquascope agri plan - use WaPOR
RETplus Open-Meteo precipitation as the first supported irrigation-planning workflow
That is the shortest path from existing code to a distinctive user-facing feature.