Metadata-Version: 2.4
Name: autoread_dotenv
Version: 1.0.5
Summary: Automatically set env-vars at the beginning of every python-process in your in-project virtualenv.
Keywords: entrypoints,dotenv,sitecustomize
Author: Wouter Vanden Hove
Author-email: Wouter Vanden Hove <wouter@libranet.eu>
License-Expression: MIT
License-File: license.md
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Typing :: Typed
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: sitecustomize-entrypoints>=1.1.0
Maintainer: Wouter Vanden Hove
Maintainer-email: Wouter Vanden Hove <wouter@libranet.eu>
Requires-Python: >=3.9
Project-URL: homepage, https://github.com/libranet/autoread-dotenv
Project-URL: repository, https://github.com/libranet/autoread-dotenv
Project-URL: documentation, https://autoread-dotenv.readthedocs.io
Description-Content-Type: text/markdown

# autoread-dotenv

[![Testing](https://img.shields.io/github/actions/workflow/status/libranet/autoread-dotenv/testing.yaml?branch=main&longCache=true&style=flat-square&label=tests&logo=GitHub%20Actions&logoColor=fff%22)](https://github.com/libranet/autoread-dotenv/actions/workflows/testing.yaml)
[![Linting](https://img.shields.io/github/actions/workflow/status/libranet/autoread-dotenv/linting.yaml?branch=main&longCache=true&style=flat-square&label=linting&logo=GitHub%20Actions&logoColor=fff%22)](https://github.com/libranet/autoread-dotenv/actions/workflows/linting.yaml)
[![Read the Docs](https://readthedocs.org/projects/autoread-dotenv/badge/?version=latest)](https://autoread-dotenv.readthedocs.io/en/latest/)
[![Codecov](https://codecov.io/gh/libranet/autoread-dotenv/branch/main/graph/badge.svg?token=QTOWRXGH61)](https://codecov.io/gh/libranet/autoread-dotenv)
[![PyPi Package](https://img.shields.io/pypi/v/autoread-dotenv?color=%2334D058&label=pypi%20package)](https://pypi.org/project/autoread-dotenv/)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/libranet/autoread-dotenv/blob/main/docs/license.md)

autoread-dotenv parses your `.env` file when starting any venv-based Python process:

![Demo](img/demo-autoread-dotenv.png)

## Installation

Install via uv:

```bash
> uv add autoread-dotenv
```

Or add to your poetry-based project:

```bash
> poetry add autoread-dotenv
```

Install via pip:

```bash
> bin/pip install autoread-dotenv
```

## Set up a local development environment

```bash
> 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\_:

```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](http://pypi.python.org/pypi/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

[![Python Version](https://img.shields.io/pypi/pyversions/autoread-dotenv?:alt:PyPI-PythonVersion)](https://pypi.org/project/autoread-dotenv/)
[![PyPI - Implementation](https://img.shields.io/pypi/implementation/autoread-dotenv?:alt:PyPI-Implementation)](https://pypi.org/project/autoread-dotenv/)

`autoread-dotenv` works on Python 3.9+, including PyPy3. Tested until Python 3.14.

## Notable dependencies

- [sitecustomize-entrypoints](http://pypi.python.org/pypi/sitecustomize-entrypoints)
- [python-dotenv](http://pypi.python.org/pypi/python-dotenv)
