Skip to content

EnvFileBackend API

EnvFileBackend(path: Union[str, Path] = '.env', load_into_environ: bool = False, encoding: str = 'utf-8')

Bases: BaseSecretBackend

.env file secrets backend with full CRUD and atomic writes.

Source code in src/credential_bridge/backends/env_file.py
Python
def __init__(
    self,
    path: Union[str, Path] = ".env",
    load_into_environ: bool = False,
    encoding: str = "utf-8",
) -> None:
    self.path = Path(path).resolve()
    self.load_into_environ = load_into_environ
    self.encoding = encoding