Skip to contents

Setup

Install the Python backend once per machine, and check it’s ready

setup_carbon_tracker()
Install codecarbon into a dedicated conda environment
carbon_tracker_ready()
Check whether codecarbon is installed and importable

Track emissions

Measure a block of code, or a longer-running/multi-phase session

with_emissions_tracked()
Track emissions for a single block of code
carbon_tracker()
Create a carbon emissions tracker

Reference data

list_carbon_tracker_countries()
List supported country codes for carbon intensity lookup