Data engineering
Auditing African agrifood trade data
Which partner countries supply Morocco’s staple imports, and where are trade declarations missing?
Solution
I normalised FAOSTAT releases into a DuckDB warehouse and matched import and export declarations while preserving missing values and reported zeros.
My contribution · I built the DuckDB model, separated reported zero values from missing records, and implemented comparison views and an offline dashboard.
Tools Python · DuckDB · SQL · Parquet · Prefect
Results
The warehouse retained 4,113 trade observations, including 857 reported zeros.
The retained release has no Moroccan declarations for the selected products in 2024.
- Trade observations retained
- 4,113 Source
Data & evaluation
Data sources
- FAOSTAT African reporter data for selected products, 2022–2024
Method
- Keep zero values distinct from unavailable records before comparing partner-reported flows.
Limitations
Mirror discrepancies can reflect reporting coverage, timing and valuation.
The absence of Moroccan declarations prevents a direct supplier estimate for this selection in 2024. A later release or an independently verified source is needed to fill the gap.
Reproduce the study
Install the Python requirements, use the specified FAOSTAT extract, then build the DuckDB warehouse and run its documented checks.
Local reproduction instructions and pinned sourceSkills demonstrated
- Dimensional data modelling
- ETL orchestration
- Data quality and reconciliation
Project figures

The shares concern declared imports. Missing declarations limit what can be inferred about concentration.
Idriss Lemnouni. FAOSTAT Detailed Trade Matrix, CC BY 4.0.Figure source
The dashboard distinguishes partner-reported values, matched declarations and uncovered pairs.
Idriss Lemnouni. FAOSTAT Detailed Trade Matrix, CC BY 4.0.Figure source