pudl.extract.xbrl#

Generic extractor for all FERC XBRL data.

Module Contents#

Classes#

FercXbrlDatastore

Simple datastore wrapper for accessing ferc1 xbrl resources.

Functions#

xbrl2sqlite_op_factory(→ collections.abc.Callable)

Generates xbrl2sqlite op for a given FERC form.

convert_form(→ None)

Clone a single FERC XBRL form to SQLite.

Attributes#

pudl.extract.xbrl.logger[source]#
class pudl.extract.xbrl.FercXbrlDatastore(datastore: pudl.workspace.datastore.Datastore)[source]#

Simple datastore wrapper for accessing ferc1 xbrl resources.

get_taxonomy(year: int, form: pudl.settings.XbrlFormNumber) tuple[io.BytesIO, str][source]#

Returns the path to the taxonomy entry point within the an archive.

get_filings(year: int, form: pudl.settings.XbrlFormNumber) io.BytesIO[source]#

Return the corresponding archive full of XBRL filings.

pudl.extract.xbrl.xbrl2sqlite_op_factory(form: pudl.settings.XbrlFormNumber) collections.abc.Callable[source]#

Generates xbrl2sqlite op for a given FERC form.

pudl.extract.xbrl.convert_form(form_settings: pudl.settings.FercGenericXbrlToSqliteSettings, form: pudl.settings.XbrlFormNumber, datastore: FercXbrlDatastore, output_path: pathlib.Path, sql_path: pathlib.Path, batch_size: int | None = None, workers: int | None = None) None[source]#

Clone a single FERC XBRL form to SQLite.

Parameters:
  • form_settings – Validated settings for converting the desired XBRL form to SQLite.

  • form – FERC form number.

  • datastore – Instance of a FERC XBRL datastore for retrieving data.

  • output_path – PUDL output directory

  • sql_path – path to the SQLite DB we’d like to write to.

  • batch_size – Number of XBRL filings to process in a single CPU process.

  • workers – Number of CPU processes to create for processing XBRL filings.

Returns:

None