Installation
Install via uv:
> uv add autoread-dotenv
Or add to your poetry-based project:
> poetry add autoread-dotenv
Install via pip:
> bin/pip install autoread-dotenv
Set up a local development environment
> just install
Usage
The only thing left to do for you is the create a .env in the root of your project.
Registered sitecustomize-entrypoint
The autoread_dotenv.entrypoint-function is registered as a sitecustomize-entrypoint in our pyproject.toml_:
[project.entry-points.sitecustomize]
autoread_dotenv = "autoread_dotenv:entrypoint"
Sitecustomize and all its registered entrypoints will be executed at the start of every python-process. For more information, please see sitecustomize-entrypoints
Avoid overriding existing environments variables
By default, your .env-file read by autoread-dotenv will override any pre-existing environment variables.
You can avoid this behaviour by setting AUTOREAD_ENFORCE_DOTENV=0.
Compatibility
autoread-dotenv works on Python 3.8+, including PyPy3. Tested until Python 3.14.