Programmatic access to Wholesale Generation data

  • 3.5K Views
  • Last post 08 December 2022
notpeerreviewed posted this 11 August 2022

Hi,

I'm trying to figure out how to access the wholesale generation by plant data through a python programmatic interface, but the link referring to python getting started appears to be broken on this page.

Any chance someone could post a simple example of how to access the data with python?

Cheers

Jeff

gk27 posted this 08 December 2022

Hey, might be a bit late for a response but you can import the data to Python using the following code:

import pandas as pd

df = pd.readcsv("https://www.emi.ea.govt.nz/Wholesale/Datasets/Generation/GenerationMD/{year}{month}Generation_MD.csv".format(year="2011", month="01"))

You can change the year and month to your liking!