pudl.extract.eia860m#

Retrieve data from EIA Form 860M spreadsheets for analysis.

This modules pulls data from EIA’s published Excel spreadsheets.

This code is for use analyzing EIA Form 860M data. EIA 860M is only used in conjunction with EIA 860. This module boths extracts EIA 860M and appends the extracted EIA 860M dataframes to the extracted EIA 860 dataframes. Example setup with pre-genrated eia860_raw_dfs and datastore as ds:

eia860m_raw_dfs = pudl.extract.eia860m.Extractor(ds).extract(

Eia860Settings.eia860m_date)

eia860_raw_dfs = pudl.extract.eia860m.append_eia860m(

eia860_raw_dfs=eia860_raw_dfs, eia860m_raw_dfs=eia860m_raw_dfs)

Module Contents#

Classes#

Extractor

Extractor for the excel dataset EIA860M.

Functions#

append_eia860m(→ dict[str, pandas.DataFrame])

Append EIA 860M to the pages to.

raw_eia860m__all_dfs(context)

Extract raw EIA 860M data from excel sheets into dict of dataframes.

extract_eia860m(raw_eia860m__all_dfs)

Extract raw EIA data from excel sheets into dataframes.

Attributes#

pudl.extract.eia860m.logger[source]#
class pudl.extract.eia860m.Extractor(*args, **kwargs)[source]#

Bases: pudl.extract.excel.ExcelExtractor

Extractor for the excel dataset EIA860M.

process_raw(df, page, **partition)[source]#

Adds source column and report_year column if missing.

static get_dtypes(page, **partition)[source]#

Returns dtypes for plant id columns.

pudl.extract.eia860m.append_eia860m(eia860_raw_dfs: dict[str, pandas.DataFrame], eia860m_raw_dfs: dict[str, pandas.DataFrame]) dict[str, pandas.DataFrame][source]#

Append EIA 860M to the pages to.

Parameters:
  • eia860_raw_dfs – EIA 860 raw tables. Result of pudl.extract.eia860.Extractor.extract()

  • eia860m_raw_dfs – EIA 860M raw tables. Restult of Extractor.extract()

Returns:

Augmented version of eia860_raw_dfs. Each raw page stored in eia860m_raw_dfs appended to its eia860_raw_dfs counterpart.

pudl.extract.eia860m.raw_eia860m__all_dfs(context)[source]#

Extract raw EIA 860M data from excel sheets into dict of dataframes.

pudl.extract.eia860m.raw_table_names = ('raw_eia860m__generator_existing', 'raw_eia860m__generator_proposed', 'raw_eia860m__generator_retired')[source]#
pudl.extract.eia860m.extract_eia860m(raw_eia860m__all_dfs: dict[str, pandas.DataFrame])[source]#

Extract raw EIA data from excel sheets into dataframes.

Parameters:

context – dagster keyword that provides access to resources and config.

Returns:

A tuple of extracted EIA dataframes.