@@ -33,7 +33,7 @@ class empty:
3333 pass
3434
3535
36- def get_env_value (name : str , required : bool = False , default : Any = empty ) -> str :
36+ def get_env_value (name : str , required : bool = False , default : Any = empty ) -> str :
3737 """
3838 Core function for extracting the environment variable.
3939
@@ -56,7 +56,7 @@ def get_env_value(name: str, required: bool=False, default: Any=empty) -> str:
5656 return value
5757
5858
59- def env_int (name : str , required : bool = False , default : Union [Type [empty ], int ]= empty ) -> int :
59+ def env_int (name : str , required : bool = False , default : Union [Type [empty ], int ] = empty ) -> int :
6060 """Pulls an environment variable out of the environment and casts it to an
6161 integer. If the name is not present in the environment and no default is
6262 specified then a ``ValueError`` will be raised. Similarly, if the
@@ -84,7 +84,9 @@ def env_int(name: str, required: bool=False, default: Union[Type[empty], int]=em
8484 return int (value )
8585
8686
87- def env_float (name : str , required : bool = False , default : Union [Type [empty ], float ]= empty ) -> float :
87+ def env_float (name : str ,
88+ required : bool = False ,
89+ default : Union [Type [empty ], float ] = empty ) -> float :
8890 """Pulls an environment variable out of the environment and casts it to an
8991 float. If the name is not present in the environment and no default is
9092 specified then a ``ValueError`` will be raised. Similarly, if the
@@ -113,9 +115,9 @@ def env_float(name: str, required: bool=False, default: Union[Type[empty], float
113115
114116
115117def env_bool (name : str ,
116- truthy_values : Iterable [Any ]= TRUE_VALUES ,
117- required : bool = False ,
118- default : Union [Type [empty ], bool ]= empty ) -> bool :
118+ truthy_values : Iterable [Any ] = TRUE_VALUES ,
119+ required : bool = False ,
120+ default : Union [Type [empty ], bool ] = empty ) -> bool :
119121 """Pulls an environment variable out of the environment returning it as a
120122 boolean. The strings ``'True'`` and ``'true'`` are the default *truthy*
121123 values. If not present in the environment and no default is specified,
@@ -143,7 +145,7 @@ def env_bool(name: str,
143145 return value in TRUE_VALUES
144146
145147
146- def env_string (name : str , required : bool = False , default : Union [Type [empty ], str ]= empty ) -> str :
148+ def env_string (name : str , required : bool = False , default : Union [Type [empty ], str ] = empty ) -> str :
147149 """Pulls an environment variable out of the environment returning it as a
148150 string. If not present in the environment and no default is specified, an
149151 empty string is returned.
@@ -167,9 +169,9 @@ def env_string(name: str, required: bool=False, default: Union[Type[empty], str]
167169
168170
169171def env_list (name : str ,
170- separator : str = ',' ,
171- required : bool = False ,
172- default : Union [Type [empty ], List [Any ]]= empty ) -> List [Any ]:
172+ separator : str = ',' ,
173+ required : bool = False ,
174+ default : Union [Type [empty ], List [Any ]] = empty ) -> List [Any ]:
173175 """Pulls an environment variable out of the environment, splitting it on a
174176 separator, and returning it as a list. Extra whitespace on the list values
175177 is stripped. List values that evaluate as falsy are removed. If not present
@@ -201,9 +203,9 @@ def env_list(name: str,
201203
202204
203205def get (name : str ,
204- required : bool = False ,
205- default : Union [Type [empty ], T ]= empty ,
206- type : Type [T ]= None ) -> T :
206+ required : bool = False ,
207+ default : Union [Type [empty ], T ] = empty ,
208+ type : Type [T ] = None ) -> T :
207209 """Generic getter for environment variables. Handles defaults,
208210 required-ness, and what type to expect.
209211
0 commit comments