getenv_path

getenv_path(envvar: str, default: Path, ensure_exists: bool = True) Path[source]

Get an environment variable representing a path, or use the default.

Parameters:
  • envvar – The environmental variable name to check

  • default – The default path to return if the environmental variable is not set

  • ensure_exists – Should the directories leading to the path be created if they don’t already exist?

Returns:

A path either specified by the environmental variable or by the default.