Metadata-Version: 2.3
Name: autoread_dotenv
Version: 1.0.4
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: # MIT License
         
         Copyright (c) 2023 [Libranet.eu](https://libranet.eu).
         
         Permission is hereby granted, free of charge, to any person
         obtaining a copy of this software and associated documentation
         files (the "Software"), to deal in the Software without
         restriction, including without limitation the rights to use,
         copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the
         Software is furnished to do so, subject to the following
         conditions:
         
         The above copyright notice and this permission notice shall be
         included in all copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
         EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
         OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
         NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
         HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
         WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
         FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
         OTHER DEALINGS IN THE SOFTWARE.
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
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 :: 3.8
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.8
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

[![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)

## 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.8+, 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)
