This repository also contains a Jupyter Notebook you can run live and experiment with, courtesy of the Binder project. The notebook can be viewed as a static version using nbviewer.

Basic example

import pyhector

output =

Advanced example

import pyhector
from pyhector import rcp26, rcp45, rcp60, rcp85

import matplotlib.pyplot as plt

for rcp in [rcp26, rcp45, rcp60, rcp85]:
    output =, {"core": {"endDate": 2100}})
    temp = output["temperature.Tgav"]
    # Adjust to 1850 - 1900 reference period
    temp = temp.loc[1850:] - temp.loc[1850:1900].mean()
plt.title("Global mean temperature")
plt.ylabel("°C over pre-industrial (1850-1900 mean)")
Temperature Plot of RCP scenarios