Skip to Content
kardashev is available for Python (PyPI) and JavaScript/TypeScript (npm)
Examples

Examples

Python

Runnable scripts live in examples/ in the source repo.

Direct ISO fuel mix

from kardashev import CAISO, ERCOT caiso = CAISO() print(caiso.get_fuel_mix().tail()) ercot = ERCOT() print(ercot.get_fuel_mix().tail())

Direct ISO LMP

from kardashev import CAISO, ERCOT, MISO caiso = CAISO() print(caiso.get_lmp(market="RT", node="TH_SP15_GEN-APND")) ercot = ERCOT() print(ercot.get_lmp(market="DA")) miso = MISO() print(miso.get_lmp(market="RT"))

Carbon intensity across all ISOs

from kardashev import Client kl = Client() print(kl.carbon_latest())

LMP map nodes

from kardashev import Client kl = Client() nodes = kl.lmp_map(iso="PJM", market="RT") print(nodes.head())

Interconnection queue

from kardashev import Client kl = Client() queue = kl.queue(iso="ERCOT", status="active") print(queue.head())

Get fuel mix for all 7 ISOs in one pass

from kardashev import Client kl = Client() mixes = {iso: kl.fuel_mix(iso=iso) for iso in ["CAISO", "ERCOT", "MISO", "NYISO", "ISONE", "SPP", "PJM"]}

JavaScript / TypeScript

Runnable scripts live in kardashev-js - all examples use the hosted API since there’s no direct ISO scraper equivalent in JavaScript.

Carbon intensity across all ISOs

import { Client } from "kardashev"; const kl = new Client(); console.log(await kl.carbonLatest());

LMP map nodes

import { Client } from "kardashev"; const kl = new Client(); const nodes = await kl.lmpMap("PJM", "RT"); console.log(nodes.slice(0, 5));

Interconnection queue

import { Client } from "kardashev"; const kl = new Client(); const queue = await kl.queue({ iso: "ERCOT", status: "active" }); console.log(queue.slice(0, 5));

Get fuel mix for all 7 ISOs in one pass

import { Client } from "kardashev"; const kl = new Client(); const isos = ["CAISO", "ERCOT", "MISO", "NYISO", "ISONE", "SPP", "PJM"]; const mixes = Object.fromEntries( await Promise.all(isos.map(async (iso) => [iso, await kl.fuelMix(iso)])) );
Last updated on