Skip to content

Instantly share code, notes, and snippets.

View awitwicki's full-sized avatar
💭
4

Andrew Witwicki awitwicki

💭
4
View GitHub Profile
@doubledare704
doubledare704 / env_property_example.py
Created August 23, 2021 08:33
decorator for properties, that will try to get ENV variable or return value from property method.
import os
from typing import Optional, Any
def get_env_var(var_name: str) -> Optional[str]:
return os.environ.get(var_name)
def env_prop(fn=None, name=None):
def env_prop_decorator(func):