项目 / gridstatus/gridstatus

gridstatus/gridstatus

行业推荐
语言 Python标签 co2-emissionsdecarbonizationelectrical-gridenergypython数据更新 2026-11-20 06:49:16 · 仓库 2026-11-19

一段话介绍

由 Grid Status 维护的开源 Python 库,用来直接从北美独立系统运营商、区域输电组织和美国 EIA、EPA 获取电力市场数据,例如负荷、燃料结构、电价和并网队列等。可用 `pip install gridstatus` 或 `uv pip install gridstatus` 安装(需 Python 3.11 及以上)。入门示例见[仓库 README](https://github.com/gridstatus/gridstatus),接口说明见[开源文档](https://opensource.gridstatus.io/)。源文另外提供带统一字段和历史归档的[托管 API](https://www.gridstatus.io/api),与本开源库相互独立。

本站整理,非 GitHub 官方 description。

官方 description(GitHub API 原样)
Extract data from ISOs and other energy grid sources
456累计星
89Fork
—峰值日增
0上榜次数
总榜
暂未入榜
日榜
暂未入榜
周榜
暂未入榜
月榜
暂未入榜

官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。

行业与场景

按行业选型 →

能耗监测与能效优化

适配系统:能源管理系统、能耗监测平台 · 得分 2.8

面向能耗采集与负荷分析建模,可用于园区/楼宇能效诊断与用能优化建议。

更多信息

以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。

我的用法
可运行 uv pip install gridstatus。
特点或设计要点
gridstatus 覆盖 CAISO、ERCOT、PJM、MISO、SPP、NYISO、ISO-NE、IESO、AESO 及美国 EIA,提供负荷、燃料结构、日前与实时 LMP 电价、储能、辅助服务价格和互联队列等数据。
星标走势还差一天的数据,明天就能看到曲线
每天 10:30 记一次星标,连续两天后自动生成曲线
首次发现 — · 最近在榜 2026-11-24 · 语言 Python · 贡献者 —
python

GitHub 项目主页介绍

来自 GitHub 仓库 README / 主页介绍正文,原样摘录,共 5,394 字节。

<p align="center">
<img width=75% src="./gridstatus-header.png" alt="gridstatus logo" />
</p>

<p align="center">
    <!-- disable until tests more reliable -->
    <!-- <a href="https://github.com/gridstatus/gridstatus/actions?query=branch%3Amain+workflow%3ATests" target="_blank">
        <img src="https://github.com/gridstatus/gridstatus/workflows/Tests/badge.svg?branch=main" alt="Tests" />
    </a> -->
    <a href="https://codecov.io/gh/gridstatus/gridstatus" target="_blank">
        <img src="https://codecov.io/gh/gridstatus/gridstatus/branch/main/graph/badge.svg" alt="Code Coverage"/>
    </a>
    <a href="https://badge.fury.io/py/gridstatus" target="_blank">
        <img src="https://badge.fury.io/py/gridstatus.svg?maxAge=2592000" alt="PyPI version">
    </a>
</p>

`gridstatus` is an open source Python library, maintained by [Grid Status](https://www.gridstatus.io/), that fetches electricity market data directly from North American independent system operators (ISOs), regional transmission organizations (RTOs), and the U.S. EIA and EPA.

<table>
  <tr>
    <td>
      ⚡ <strong>Have you considered our <a href="https://www.gridstatus.io/api">Hosted API</a>?</strong><br>
      It provides a consistent schema across markets, a maintained historical archive, and server-side filtering. Python users can query it with <a href="https://github.com/gridstatus/gridstatusio"><code>gridstatusio</code></a>; other languages can use the REST API directly.
    </td>
  </tr>
</table>

## Contents

- [Open source `gridstatus` vs. the hosted Grid Status API](#open-source-gridstatus-vs-the-hosted-grid-status-api)
- [Installation](#installation)
- [Getting started](#getting-started)
- [What's available](#whats-available)
- [Resources and help](#resources--help)

## Open source `gridstatus` vs. the hosted Grid Status API

Choose between the open source library and the hosted Grid Status API based on how you want to access and work with the data:

| Open source `gridstatus` | Hosted [Grid Status API](https://www.gridstatus.io/api) and [`gridstatusio`](https://github.com/gridstatus/gridstatusio) |
|--------------------------|-----------------------------------------------------------------------------------------------------------------------|
| Minimally processed data fetched directly from ISO, EIA, and EPA sources | Hosted data with consistent column names, timestamp formats, and DST handling |
| Python library with source-specific integrations and fields | Single REST API with a Python client |
| No Grid Status account; most datasets require no API key | Grid Status API key with free and paid plans |
| Historical availability depends on each source's retention policy | Historical data queryable immediately |
| Filtering capabilities vary by source | Consistent server-side filtering by time, columns, and row values |

## Installation

`gridstatus` supports Python 3.11+. Install with uv or pip:

```bash
uv pip install gridstatus
# or
pip install gridstatus
```

Some sources require credentials, such as an EIA API key or ERCOT API username and password. See [.env.template](.env.template) for the full list and supported environment variables.

## Getting started

```python
from gridstatus import CAISO, Ercot, SPP, list_isos

# See the ISO classes exposed by the discovery helper
list_isos()

# Pick an ISO and pull a dataset for a fixed date
iso = Ercot()
fuel_mix = iso.get_fuel_mix("2024-06-01")

# Source-specific methods expose other datasets and market intervals
ercot_lmp = Ercot().get_lmp_by_settlement_point("2024-06-01")
spp_lmp = SPP().get_lmp_real_time_5_min_by_location("2024-06-01")
real_time_15_min_lmp = CAISO().get_lmp_real_time_15_min("2024-06-01")
day_ahead_hourly_lmp = CAISO().get_lmp_day_ahead_hourly("2024-06-01")

print(fuel_mix.head())
```

Most dataset methods return pandas DataFrames, with timezone-aware columns for time-indexed data; columns vary by method and source. Date arguments accept `"today"`, `"latest"`, `"historical"`, an ISO-8601 string (`"2024-06-01"`), a `pd.Timestamp`, or a `(start, end)` range — **interpreted in the ISO's own local timezone**. Use fixed dates for reproducible results.

## What's available

Available data includes load, fuel mix, forecasts, locational marginal prices (LMPs), storage, ancillary services, interconnection queues, and more. Coverage and historical availability vary by source.

- **ISOs / RTOs / grids:** CAISO, ERCOT, PJM, MISO, SPP, NYISO, ISO-NE, IESO, and AESO, plus the U.S. EIA and EPA.
- **Datasets (vary by ISO):** fuel mix, load (demand), load forecasts, locational marginal prices (LMP, day-ahead & real-time), storage, ancillary-service prices, interconnection queues, and more.

The exact dataset coverage per ISO is documented in the [API reference](https://opensource.gridstatus.io/).

## Resources & help

- **Open source:** [API reference and examples](https://opensource.gridstatus.io/) · [Changelog](CHANGELOG.md) · [Contributing](CONTRIBUTING.md)
- **Hosted API:** [data catalog](https://www.gridstatus.io/datasets) · [OpenAPI spec](https://api.gridstatus.io/openapi.json) · [docs assistant](https://docs.gridstatus.io/)
- **Support:** Open a [GitHub issue](https://github.com/gridstatus/gridstatus/issues) for questions or bugs. Grid Status support is primarily focused on hosted API users, but we'll do our best to help with open source issues.
↑