parse_env#

parse_env(var, default=None, which='str')[source]#

Simple function to parse environment variables

Parameters:
  • var (str) – name of the environment variable to get

  • default (any) – default value

  • which (str) – what type to convert to (if None, don’t convert)

Example:

sc.parse_env('MY_FACTOR', default=3.5, which=float)
New in version 2.0.0.
New in version 3.2.1: allow actual types