File size: 477 Bytes
0d18784
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import os
from dotenv import load_dotenv

# Load environment variables from a .env file
load_dotenv()

def get_config(key: str, default: str = None) -> str:
    """
    Retrieve a configuration value from environment variables.

    Args:
        key (str): The key of the configuration.
        default (str): The default value if the key is not found.

    Returns:
        str: The value of the configuration or the default value.
    """
    return os.getenv(key, default)