rebuild(stage-1): establish isolated application skeleton
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class Settings:
|
||||
environment: str
|
||||
debug: bool
|
||||
data_directory: Path
|
||||
|
||||
@classmethod
|
||||
def from_environment(cls) -> Settings:
|
||||
environment = os.getenv("APP_ENV", "development").strip().lower()
|
||||
data_directory = Path(os.getenv("APP_DATA_DIR", "data")).resolve()
|
||||
return cls(
|
||||
environment=environment,
|
||||
debug=environment == "development",
|
||||
data_directory=data_directory,
|
||||
)
|
||||
Reference in New Issue
Block a user