Skip to main content

Module env

Module env 

Source
Expand description

Safe environment variable parsing with defaults.

Functions§

get
Read a string environment variable.
get_bool
Safely parse boolean variables. Recognizes “true”, “1”, “yes”, “on” as true, and “false”, “0”, “no”, “off” as false. If the variable is unset or unrecognized, returns the fallback value.
get_non_empty
Read a string environment variable and ignore empty values.
get_or
Read a string environment variable with a fallback value.
get_parsed
Read and parse an environment variable into any type implementing FromStr. Returns None if the variable is not set or if parsing fails.