Tools for setting up and managing PUDL workspaces.

Module Contents#



These settings provide access to various PUDL directories.


class pudl.workspace.setup.PudlPaths(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: pydantic_settings.sources.DotenvType | None = ENV_FILE_SENTINEL, _env_file_encoding: str | None = None, _env_ignore_empty: bool | None = None, _env_nested_delimiter: str | None = None, _env_parse_none_str: str | None = None, _secrets_dir: str | pathlib.Path | None = None, **values: Any)[source]#

Bases: pydantic_settings.BaseSettings

These settings provide access to various PUDL directories.

It is primarily configured via PUDL_INPUT and PUDL_OUTPUT environment variables. Other paths of relevance are derived from these.

property input_dir: pathlib.Path[source]#

Path to PUDL input directory.

property output_dir: pathlib.Path[source]#

Path to PUDL output directory.

property settings_dir: pathlib.Path[source]#

Path to directory containing settings files.

property data_dir: pathlib.Path[source]#

Path to PUDL data directory.

property pudl_db: str[source]#

Returns url of locally stored pudl sqlite database.

pudl_input: PotentialDirectoryPath[source]#
pudl_output: PotentialDirectoryPath[source]#

Create PUDL input and output directories if they don’t already exist.

sqlite_db_uri(name: str) str[source]#

Returns url of locally stored pudl sqlite database with given name.

The name is expected to be the name of the database without the .sqlite suffix. E.g. pudl, ferc1 and so on.

parquet_path(table_name: str | None = None) pathlib.Path[source]#

Return path to parquet file for given database and table.

sqlite_db_path(name: str) pathlib.Path[source]#

Return path to locally stored SQLite DB file.

output_file(filename: str) pathlib.Path[source]#

Path to file in PUDL output directory.

static set_path_overrides(input_dir: str | None = None, output_dir: str | None = None) None[source]#

Set PUDL_INPUT and/or PUDL_OUTPUT env variables.

  • input_dir – if set, overrides PUDL_INPUT env variable.

  • output_dir – if set, overrides PUDL_OUTPUT env variable.