Metadata-Version: 2.1
Name: envease
Version: 1.0.0
Summary: A Python package to easily work with environment variables, inspired by the method used in Laravel framework to read the .env file.
Home-page: https://github.com/Persian-Immortal/envutils
Author: Alireza Abedini
License: MIT
Keywords: management,organizing,variables,variable,environment,environment variables,easy,simple,simplest,easiest
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: certifi==2024.2.2
Requires-Dist: charset-normalizer==3.3.2
Requires-Dist: docutils==0.20.1
Requires-Dist: idna==3.6
Requires-Dist: importlib-metadata==7.0.1
Requires-Dist: jaraco.classes==3.3.1
Requires-Dist: keyring==24.3.1
Requires-Dist: markdown-it-py==3.0.0
Requires-Dist: mdurl==0.1.2
Requires-Dist: more-itertools==10.2.0
Requires-Dist: nh3==0.2.15
Requires-Dist: pkginfo==1.9.6
Requires-Dist: Pygments==2.17.2
Requires-Dist: python-dotenv==1.0.1
Requires-Dist: pywin32-ctypes==0.2.2
Requires-Dist: readme_renderer==43.0
Requires-Dist: requests==2.31.0
Requires-Dist: requests-toolbelt==1.0.0
Requires-Dist: rfc3986==2.0.0
Requires-Dist: rich==13.7.0
Requires-Dist: setuptools==69.1.1
Requires-Dist: twine==5.0.0
Requires-Dist: urllib3==2.2.1
Requires-Dist: zipp==3.17.0
Requires-Dist: wheel==0.42.0

# EnvEase
A Python package to easily work with environment variables, inspired by the method used in [Laravel](https://github.com/laravel/laravel) framework to read the `.env` file.

## Installation
You can install `envease` via pip:
```bash
pip install envease
```

## Usage
if you only want to use a single `.env` file where the python file is located then you can import the package like this:
```py
from envease import env
```
then the usage is gonna be simple:
```bash
# inside the .env file
KEY="Hello, World"
```
```py
print(env('KEY')) # prints the "Hello, World" message
```
---
else if you want to use other environment variable files than `.env` you can use the package like this:
```py
from envease import *

load_env_file('file_name')
print('KEY') # this prints the value inside the 'KEY' inside the 'file_name' file
```
---
you can even dynamically call different environment variable files
```py
from envease import *
env_files = {
    "first": ".first.env",
    "second": ".second.env",
    "third": ".third.env",
}

load_multiple(env_files)

print(dynamic_env('first', 'KEY')) # this will print the value addressed with 'KEY' inside the .first.env file
```
> ***Notice:*** you can as well handle default values if the returned value is null!
```py
print('KEY', 'default value') # this prints the value addressed with 'KEY' inside the environment variables. if it was null it will print 'default value' as a string
print(dynamic_env('first', 'KEY'), 'default value') # this prints the value addressed with 'KEY' inside the environment variables addressed with 'first' key in the dictionary. if it was null it will print 'default value' as a string
```

---

# Contributing
Contributions are welcome! If you have any suggestions, feature requests, or bug reports, please [open an issue](https://github.com/Persian-Immortal/envease/issues/new
) or submit a pull request.

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