Skip to main content

agrifoodpy-data

AgriFoodPy Data is a data repository and companion package to AgriFoodPy, providing easy access to curated datasets related to agriculture, food systems, environmental impacts, land use, and population. These datasets are essential for modeling, analysis, and research in sustainable food systems.

All datasets are stored in NetCDF format and loaded as xarray DataArrays or Datasets for efficient handling in Python.

Datasets

FAOSTAT food balance sheet

  • Can be found at www.fao.org/faostat/en/#data/FBS
  • Food supply elements disaggregated into country, item, and year. Elements include production, imports, exports and domestic use, among others.
  • It is the basis of the calculator, and defines the baseline scenario from which we project consumption and production towards 2050

Nationally determined contributions (NDC)

  • Can be found at unfccc.int/nationally-determined-contributions-ndcs
  • The NDCs are climate action plans submitted by each country as part of the Paris Agreement. They report past emissions using a standardized form (National Inventory Report) and describe the policies and actions planned and in action to reduce emissions by 2050.

Nature England Agricultural Land Classification (ALC) data

  • Alias: not yet included in Agrifoodpy (currently in NaturalEngland/Reading_ALC_data.ipynb)
  • Can be found at naturalengland-defra.opendata.arcgis.com/datasets
  • Using a combination of different geographical and climate datasets, the ALC map grades land based on its agricultural capabilities, ranging from least productive (grade 5, typically mountains, high gradient pasture, rocky soils, urban areas) to most productive (low altitude, low gradient, moderate rainfall, nutrient rich soils). The dataset is distributed as a vector map of different grades, but we have rasterised it to match the CEH grid. Both geospatial datasets are matched to the British National Grid

UK Centre for Ecology and Hydrology Land Cover maps (UK CEH)

  • Alias: not yet included in Agrifoodpy
  • Can be found at ceh.ac.uk/data, while 1000m rasterised data can be downloaded from catalogue.ceh.ac.uk/documents
  • The CEH land cover maps are generated using machine learning on remote sensing images, and present a description of the different land use types in the UK. While the main dataset provides utilisation values for a grid with a resolution of 25m, we use the summary 1km grid maps to identify and map food production in the UK.

UK Centre for Ecology and Hydrology Land Cover Plus crop maps

  • Can be found at ceh.ac.uk/services/ceh-land-cover-plus-crops-2015. Data can be accessed through a free academic licence from Digimap digimap.edina.ac.uk.
  • A catalogue of land parcels classified by crop types is generated using remote sensing data from two satellites, Copernicus Sentinel-1 C-band SAR and Sentinel-2 optical imaging. Land Cover Plus provides data for the 2016-2020 year range.

UK Office of National Statistics population tables

  • Alias: from agrifoodpy.population.population import UK_ONS which can be downloaded in zip format here: ons.gov.uk/file

United Nations (UN) population data

  • Alias: from agrifoodpy.population.population import UN
  • The original CSV file read in this notebook can be obtained here: population.un.org
  • This dataset provides country-level population estimates and projections by year, using multiple scenarios for fertility, mortality, and international migration. In Agrifood these are employed to project the change in domestic consumption relative to today’s values.

UK Office of National Statistics boundary data

  • Alias: from agrifoodpy.land import ONS_CTRY_DEC_2024_UK_BUC_1000
  • Available for download from the Office for National Statistics Open Geography Portal
  • Boundaries for Local Authority District, countries and other administrative regions.

For a full list of datasets please visit

Installation

To intall AgriFoodPy Data during development:

pip install git+https://github.com/FixOurFood/agrifoodpy-data.git

For stable releases, use:

pip install agrifoodpy-data

If you want the geo utilities in agrifoodpy_data.land.utils, install the optional extra:

pip install "agrifoodpy-data[geo]"

Usage

AgriFoodPy Data integrates seamlessly with AgriFoodPy to load and utilize datasets in both pipeline and interactive modes.

Interactive mode

In interactive mode, datasets are loaded as module atributes by importing them

from agrifoodpy_data.food import FAOSTAT

Alternatively, datasets can be imported using the load_dataset function of AgriFoodPy in standalone mode.

from agrifoodpy.utils.nodes import load_dataset

FAOSTAT = load_dataset(module="agrifoodpy_data.food", data_attr="FAOSTAT")

Pipeline mode

In pipeline mode, datasets can be stored in an AgriFoodPy Pipeline datablock using the load_dataset module and used in other modules further along the pipleine

import agrifoodpy as afp

pipe = afp.pipeline.Pipeline()
pipe.add_node(
    afp.utils.nodes.load_dataset,
    name="Load fbs",
    params={
        "datablock_path": "fbs",
        "module": "agrifoodpy_data.food",
        "data_attr": "FAOSTAT",
        "coords": {
            "Item": [2731, 2511],
            "Year": [2019, 2020],
            "Region": 229},
    }
)

# add more nodes to work with the loaded dataset

Contributing

Contributions are welcome! Please see the main AgriFoodPy repository for guidelines.

Metadata

Release files for agrifoodpy-data 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agrifoodpy-data 0.1.0
File Size Uploaded
agrifoodpy_data-0.1.0.tar.gz 38.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for agrifoodpy-data 0.1.0
File Interpreter ABI Platform
agrifoodpy_data-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 76.2 MB

Release files / agrifoodpy_data-0.1.0.tar.gz

Download URL agrifoodpy_data-0.1.0.tar.gz
Size 38.1 MB
Tags Source
SHA-256 checksum
How to use checksums
f2505bd435576b07b17310bd29b5589285bdcf8ca2a77c0525f6bdbca5620d50
BLAKE2b-256 checksum
How to use checksums
7108f721a2270fd72063c4bf1d9af49e9d843283eef05ff3eb1cb06b37088e2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / agrifoodpy_data-0.1.0-py3-none-any.whl

Download URL agrifoodpy_data-0.1.0-py3-none-any.whl
Size 38.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c1480be0eb094ad85b993fd029c32b513134ae06ff0522e1b827008e5528b4e4
BLAKE2b-256 checksum
How to use checksums
a338fd8129c9fa7b0224c8f386ef9237623a0812f0d0d9f5013e60e9952ce779
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page