Overview
Open Electricity provides SDKs to access the API in TypeScript / JavaScript or Python.
Typescript SDK
The Typescript SDK is available on NPM.
It supports accessing the API synchronously and asynchronously, and includes a built in data and record table tools for analysing data.
Installation
The Typescript SDK is available on NPM at openelectricity.
Install the SDK using your preferred package manager:
npm
bashnpm install openelectricityyarn
bashyarn add openelectricitypnpm
bashpnpm add openelectricitybun
bashbun add openelectricityQuick Start
import { OpenElectricityClient } from 'openelectricity'
// Initialize the client
const client = new OpenElectricityClient()
// Get energy data for the NEM
const { datatable } = await client.getNetworkData('NEM', ['energy'], {
interval: '1h',
dateStart: '2024-01-01T00:00:00',
dateEnd: '2024-01-02T00:00:00',
primaryGrouping: 'network_region',
})
// Analyze the data
console.table(datatable.toConsole())Python SDK
The Python SDK is available on PyPI.
It supports accessing the API synchronously and asynchronously, and exporting results to either pandas or polars DataFrames.
Installation
The Python SDK is available on PyPI at openelectricity.
Install the SDK using your preferred package manager:
pip
bashpip install openelectricityuv
bashuv add openelectricityQuick Start
from openelectricity import OpenElectricityClient
# Initialize the client
client = OpenElectricityClient()
# Get energy data for the NEM
datatable = client.get_network_data('NEM', ['energy'], {
interval: '1h',
dateStart: '2024-01-01T00:00:00',
dateEnd: '2024-01-02T00:00:00',
primaryGrouping: 'network_region',
})