getenv_path

getenv_path(envvar, default, ensure_exists=True)[source]

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

Parameters:
  • envvar (str) – The environmental variable name to check

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

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

Return type:

Path

Returns:

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