def get(<EOL>self,<EOL>key: str,<EOL>default: typing.Any = UNSET,<EOL>type_: typing.Type[typing.Any] = str,<EOL>subtype: typing.Type[typing.Any] = str,<EOL>mapper: typing.Optional[typing.Callable[[object], object]] = None,<EOL>) -> typing.Any:
value = self.environ.get(key, UNSET)<EOL>if value is UNSET and default is UNSET:<EOL><INDENT>raise ConfigError("<STR_LIT>".format(key))<EOL><DEDENT>if value is UNSET:<EOL><INDENT>value = default<EOL><DEDENT>else:<EOL><INDENT>value = self.parse(typing.cast(str, value), type_, subtype)<EOL><DEDENT>if mapper:<EOL><INDENT>value = mapper(value)<EOL><DEDENT>return value<EOL>
Parse a value from an environment variable.

.. code-block:: python

   >>> os.environ['FOO']
   <<< '12345'
   >>>
   >>> os.environ['BAR']
   <<< '1,2,3,4'
   >>>
   >>> 'BAZ' in os.environ
   <<< False
   >>>
   >>> parser = Config()
   >>> parser.get('FOO', type_=int)
   <<< 12345
   >>>
   >>> parser.get('BAR', type_=list, subtype=int)
   <<< [1, 2, 3, 4]
   >>>
   >>> parser.get('BAZ', default='abc123')
   <<< 'abc123'
   >>>
   >>> parser.get('FOO', type_=int, mapper=lambda x: x*10)
   <<< 123450

:param key: the key to look up the value under
:param default: default value to return when when no value is present
:param type\\_: the type to return
:param subtype: subtype for iterator types
:param mapper: a function to post-process the value with
:return: the parsed config value