1.5.0 • Published 10 months ago

@zhiweiliu/nz-energy-public-datasets v1.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

New Zealand Energy Public Datasets

The utilities load public datasets from the New Zealand energy market. These datasets are hosted on websites such as the Electricity Authority, Electricity Market Information, and Transpower.

The NPM package of the utilities is here.

npm i @zhiweiliu/nz-energy-public-datasets

1. Electricity Authority Participants

The information is hosted on New Zealand EA Website Register Page.

To load the list of EA participants:

import {
  Participants,
  ParticipantResponse,
} from "@zhiweiliu/nz-energy-public-datasets";

/**
 * The loadParticipants() method can accept an optional local folder parameter, which
 * specifies the directory to temporarily store downloaded information before processing.
 * By default, this folder is set to "/tmp".
 **/
const participants = new Participants();
const ps: ParticipantResponse = await participants.loadPartificipants(
  "/to/local/folder"
);

2. Electricity Authority Third Party Providers

The information is hosted on the "Third-party providers" tab of New Zealand EA Website Identifiers Page.

To load the list of EA third-party providers:

import ThirdPartyProviders from "@zhiweiliu/nz-energy-public-datasets";

const tpps = new ThirdPartyProviders();
const providers: ThirdPartyProviderResponse =
  await tpps.loadThirdPartyProviders();

3. Network Supply Points (NSP)

The information is hosted on the Electricity Market Information website.

To load a list of files:

let nsps = new NetworkSupplyPoints();
let files = await nsps.loadFileList();

To download a specific NSP file:

let nsps = new NetworkSupplyPoints();
let files = await nsps.loadFileList();
const localPath = "/tmp/networkSupplyPoint";
// download the latest NSP file
await nsps.downloadFile(files[0], `${localPath}/${files[0]}`);

// TODO: copy to the location you would like to store the file

// delete downloaded file from the temporary folder
await nsps.crawler.deleteFolderRecursively(`${localPath}/${files[0]}`);

To load NSP data into a collection of objects:

let nsps = new NetworkSupplyPoints();
let files = await nsps.loadFileList();
let nspsResp = await nsps.loadNetworkSupllyPoints(files[0]);
1.4.3

10 months ago

1.4.2

10 months ago

1.5.0

10 months ago

1.4.1

10 months ago

1.4.0

10 months ago

1.3.3

12 months ago

1.3.2

12 months ago

1.3.1

12 months ago

1.3.0

12 months ago

1.2.2

12 months ago

1.2.1

12 months ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago