File size: 497 Bytes
e4f9cbe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""Load environment variables from .env file."""
import os
from typing import Optional

from dotenv import dotenv_values

CONFIG: dict[str, Optional[str]] = {
  **dotenv_values('.env'),  # load shared variables
  **dotenv_values('.env.local'),  # load locally set variables
  **os.environ,  # override loaded values with environment variables
}


def data_path() -> str:
  """Return the base path for data."""
  if CONFIG['LILAC_DATA_PATH']:
    return CONFIG['LILAC_DATA_PATH']
  return './data'