geotribu_cli.utils.str2bool module

Basic string to bool.

geotribu_cli.utils.str2bool.str2bool(input_var, raise_exc=False)

Determine if a string is a bool and, if so, convert it.

Paramètres:
  • input_var (str) – value to convert

  • raise_exc (bool, optional) – strict mode, defaults to False. Defaults to False.

Lève:
  • ValueError – input_var is not in true and false sets

  • TypeError – if input_var is not a str or a bool

Renvoie:

True if input_var is in _true_set, False if it’s in _false_set.

Type renvoyé:

bool

None or Exception if not in any of two sets.