plesty.server.model.envfile =========================== .. py:module:: plesty.server.model.envfile .. autoapi-nested-parse:: A device's ``.env`` file: the values plesty-lib's ``EnvSettings`` reads. Every hub device reads its instrument address, credentials and report archive from ``.env`` in its working directory — the same file for the server and the field test. On a bench that file is ``/run//.env`` (the server's working directory); the presenter also folds it into the environment of a field-test run, whose working directory is the checkout. The format is the usual dotenv subset: ``KEY=VALUE`` per line, ``#`` comments, optional single or double quotes around the value, ``export`` prefix ignored. Attributes ---------- .. autoapisummary:: plesty.server.model.envfile.ENV_FILENAME Functions --------- .. autoapisummary:: plesty.server.model.envfile.parse_env plesty.server.model.envfile.render_env plesty.server.model.envfile.read_env plesty.server.model.envfile._quote Module Contents --------------- .. py:data:: ENV_FILENAME :value: '.env' .. py:function:: parse_env(text: str) -> dict[str, str] Parse dotenv *text* into a mapping (later keys win). .. py:function:: render_env(values: collections.abc.Mapping[str, str]) -> str Render a mapping as dotenv text (one ``KEY=VALUE`` per line, quoted when needed). .. py:function:: read_env(path: str | os.PathLike[str]) -> dict[str, str] Parse the file at *path*; empty when it does not exist. .. py:function:: _quote(value: str) -> str