# An access library for the world crop, food production and consumption datasets

*2025-04-01 — idea*


Agricultural habitat degradation is a leading threat to global biodiversity. To
make informed decisions, it's crucial to understand the [biodiversity impacts of various foods](https://anil.recoil.org/papers/2024-food-life), their origins, and potential mitigation strategies. Insights can
drive actions from national policies to individual dietary choices. Key factors
include knowing where crops are grown, their yields, and food sourcing by
country.

The [FAOSTAT trade data](https://www.fao.org/faostat/en/#home) offers
comprehensive import and export records since 1986, but its raw form is
complex, including double counting, hindering the link between production and
consumption.


While Kastner et al. proposed a method[^1] to address this, it has only been
applied to 2013 data[^2] so far. Creating a reproducible pipeline for
processing FAO trade data across years is essential for assessing how global
trade changes affect biodiversity. For instance, how has Brexit impacted the
UK's food sourcing and biodiversity? What are the repercussions of emerging
producers on ecosystems?

## The summer project

There exists a Python [faostat](https://pypi.org/project/faostat/) library to
act as an interface to the raw CSV. And in 2024, a bunch of food hackers released
[AgriFoodPy](https://joss.theoj.org/papers/10.21105/joss.06305) [^3] which is a package
for modelling food systems.

In this project, we'd like to:
- port a bunch of R code to Python using faostat/agrifoodpy and verify the outputs are broadly the same
- determine strategies to incrementaly update and reproduce FAO data on top of these libraries so we can do more frequent updates and tailoring
- apply it to the code backing the "[Food impacts on species extinction risks can vary by three orders of magnitude](https://anil.recoil.org/papers/2024-food-life)" paper

This would be a good summer project for a student interested in getting to
grips with scientific computing, such as Python, Rscript, and dataframes
libraries.  If the core is done early, then we can investigate visualisations
as well.  And of course, if you're interested in sustainability, is this is a
[great topic](https://anil.recoil.org/notes/cambridge-green-blue) to start on\!

See also:
- AgrifoodPy food calculator at <https://agrifood-consultation.streamlit.app/>

[^1]: Kastner T, Kastner M, Nonhebel S (2011): [Tracing distant environmental impacts of agricultural products from a consumer perspective](https://doi.org/10.1016/j.ecolecon.2011.01.012). Ecol Econ 70:1032–1040.

[^2]: Schwarzmueller, F., Kastner, T. [Agricultural trade and its impacts on cropland use and the global loss of species habitat](https://link.springer.com/article/10.1007/s11625-022-01138-7#Sec13). Sustain Sci 17, 2363–2377 (2022).

[^3]: Cordero, Juan P. et al. [AgriFoodPy: a package for modelling food systems](https://joss.theoj.org/papers/10.21105/joss.06305). Journal of Open Source Software (2024).
Status: Expired
Level: Any
Year: 2025
Project: Mapping LIFE on Earth
Supervisors: Anil Madhavapeddy, Alison Eyres, Thomas Ball

## Related

- [A scorching CNG London during Climate Action Week](https://anil.recoil.org/notes/cng-london-2026) (note, 2026-06-24)
- [Food impacts on species extinction risks can vary by three orders of magnitude](https://anil.recoil.org/papers/2024-food-life) (paper, 2025-09-01)
- [The Cambridge "Green Blue" competition to reduce emissions](https://anil.recoil.org/notes/cambridge-green-blue) (note, 2025-05-06)

---
Canonical: https://anil.recoil.org/ideas/food-provenance-fao
Type: idea
License: CC BY 4.0 <https://creativecommons.org/licenses/by/4.0/>
Tags: conservation, biodiversity, food, urop
