autoread_dotenv.utils

autoread_dotenv.utils.

We assume following directory-structure: The virtualenv of your project must be created as a .venv-subfolder inside your project-directory.

This corresponds to poetry-config “in-project = true”. The .env-file must reside in the root of your project-directory.

<project-root>
    .env
    .venv/
        bin/
            python
        lib/
        lib64/
        pyvenv.cfg

We also support toplevel-symlinks to the corresponding .venv-files:
bin/       -> .venv/bin/
lib/       -> .venv/lib/
lib64/     -> .venv/lib64/
pyvenv.cfg -> .venv/pyvenv.cfg

Classes

SimpleWarning

Simple warning-formatting .

Functions

get_dotenv_path()

Return the location of the .env for in-project virtualenvs.

str_to_bool(value)

Convert a string value to a boolean.

Module Contents

class autoread_dotenv.utils.SimpleWarning

Simple warning-formatting .

old_format: Callable | None
__enter__()

Enter contextmanager.

Return type:

typing_extensions.Self

__exit__(*args, **kwargs)

Exit contextmanager.

Parameters:
  • args (object)

  • kwargs (dict[str, Any])

Return type:

None

static simple_message(message)

Return a simple warning-message without any traceback-info.

Parameters:

message (str)

Return type:

str

autoread_dotenv.utils.get_dotenv_path()

Return the location of the .env for in-project virtualenvs.

Return None of the .env-file does not exist.

Return type:

pathlib.Path | None

autoread_dotenv.utils.str_to_bool(value)

Convert a string value to a boolean.

Parameters:

value (str)

Return type:

bool