Metadata-Version: 2.1
Name: pyauto-dotenv
Version: 0.1.0
Summary: Automatically load .env variables if auto-dotenv is installed
Project-URL: Repository, https://github.com/hmiladhia/auto-dotenv
Project-URL: Issues, https://github.com/hmiladhia/auto-dotenv/issues
Author-email: Dhia Hmila <dhiahmila.dev@gmail.com>
Maintainer-email: Dhia Hmila <dhiahmila.dev@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Hmila Dhia
        
        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.
License-File: LICENSE
Keywords: configurations,dotenv,env,environment variables,secrets
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: python-dotenv>=1.0.1
Description-Content-Type: text/markdown

# pyauto-dotenv
![PyPI](https://img.shields.io/pypi/v/pyauto-dotenv)
![PyPI - License](https://img.shields.io/pypi/l/pyauto-dotenv)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/pyauto-dotenv)

![Tests](https://github.com/hmiladhia/auto-dotenv/actions/workflows/quality.yaml/badge.svg)

`pyauto-dotenv` is a python package that simplifies the process of loading environment variables from a `.env`
file in your project. With `pyauto-dotenv`, you no longer need to manually load the `.env` file in your code.
This package automatically loads the variables from the `.env` file if the `auto-dotenv` package is installed
in your environment.

`pyauto-dotenv` is just a wrapper around `python-dotenv`. In fact what it does is basically run the following code everytime you run a python file:

```python
from dotenv import load_dotenv

load_dotenv()
```

### Installation

You can install `pyauto-dotenv` via pip:

```bash
pip install pyauto-dotenv
```

### Usage

Using `pyauto-dotenv` is straightforward. Once you've installed the package, that's it!
If a `.env` file is present in your project directory,
`pyauto-dotenv` will automatically load its contents into the environment.

You can define the following environment variable to override the default .env file: `AUTO_DOTENV_PATH`, `AUTO_DOTENV_ENV`

### Example

Let's say you have a `.env` file with the following contents:

```
DB_HOST=localhost
DB_USER=admin
DB_PASS=password123
```

Normally, you would need to load these variables manually in your code. However, with `pyauto-dotenv`, you can access these variables directly from the environment:

```python
import os

print(os.environ['DB_HOST'])  # Output: localhost
print(os.environ['DB_USER'])  # Output: admin
print(os.environ['DB_PASS'])  # Output: password123
```

### Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on [GitHub](https://github.com/hmiladhia/auto-dotenv).

### License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

### Disclaimer

This package comes with no warranties or guarantees. Use it at your own risk.
