pyauto-dotenv


Namepyauto-dotenv JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryAutomatically load .env variables if auto-dotenv is installed
upload_time2024-03-09 14:48:31
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT 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.
keywords configurations dotenv env environment variables secrets
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pyauto-dotenv",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Dhia Hmila <dhiahmila.dev@gmail.com>",
    "keywords": "configurations,dotenv,env,environment variables,secrets",
    "author": "",
    "author_email": "Dhia Hmila <dhiahmila.dev@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/1b/22/fc5661badc9744eaa0def627a96dbc76313c6d34b19a7ef8c52561060a14/pyauto_dotenv-0.1.0.tar.gz",
    "platform": null,
    "description": "# pyauto-dotenv\n![PyPI](https://img.shields.io/pypi/v/pyauto-dotenv)\n![PyPI - License](https://img.shields.io/pypi/l/pyauto-dotenv)\n![PyPI - Wheel](https://img.shields.io/pypi/wheel/pyauto-dotenv)\n\n![Tests](https://github.com/hmiladhia/auto-dotenv/actions/workflows/quality.yaml/badge.svg)\n\n`pyauto-dotenv` is a python package that simplifies the process of loading environment variables from a `.env`\nfile in your project. With `pyauto-dotenv`, you no longer need to manually load the `.env` file in your code.\nThis package automatically loads the variables from the `.env` file if the `auto-dotenv` package is installed\nin your environment.\n\n`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:\n\n```python\nfrom dotenv import load_dotenv\n\nload_dotenv()\n```\n\n### Installation\n\nYou can install `pyauto-dotenv` via pip:\n\n```bash\npip install pyauto-dotenv\n```\n\n### Usage\n\nUsing `pyauto-dotenv` is straightforward. Once you've installed the package, that's it!\nIf a `.env` file is present in your project directory,\n`pyauto-dotenv` will automatically load its contents into the environment.\n\nYou can define the following environment variable to override the default .env file: `AUTO_DOTENV_PATH`, `AUTO_DOTENV_ENV`\n\n### Example\n\nLet's say you have a `.env` file with the following contents:\n\n```\nDB_HOST=localhost\nDB_USER=admin\nDB_PASS=password123\n```\n\nNormally, you would need to load these variables manually in your code. However, with `pyauto-dotenv`, you can access these variables directly from the environment:\n\n```python\nimport os\n\nprint(os.environ['DB_HOST'])  # Output: localhost\nprint(os.environ['DB_USER'])  # Output: admin\nprint(os.environ['DB_PASS'])  # Output: password123\n```\n\n### Contributing\n\nContributions 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).\n\n### License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n### Disclaimer\n\nThis package comes with no warranties or guarantees. Use it at your own risk.\n",
    "bugtrack_url": null,
    "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.",
    "summary": "Automatically load .env variables if auto-dotenv is installed",
    "version": "0.1.0",
    "project_urls": {
        "Issues": "https://github.com/hmiladhia/auto-dotenv/issues",
        "Repository": "https://github.com/hmiladhia/auto-dotenv"
    },
    "split_keywords": [
        "configurations",
        "dotenv",
        "env",
        "environment variables",
        "secrets"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4280fc524bf1f80e00a328cbd9507ce36449e55e475ad1284005490a6a3c1ce",
                "md5": "2698628f82d133e171003034c2a4bd43",
                "sha256": "daf3a03c8d05dbbbfa3b56748231a5d06799c06c503ef6e4b7a5030261c798be"
            },
            "downloads": -1,
            "filename": "pyauto_dotenv-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2698628f82d133e171003034c2a4bd43",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4039,
            "upload_time": "2024-03-09T14:48:29",
            "upload_time_iso_8601": "2024-03-09T14:48:29.713741Z",
            "url": "https://files.pythonhosted.org/packages/f4/28/0fc524bf1f80e00a328cbd9507ce36449e55e475ad1284005490a6a3c1ce/pyauto_dotenv-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b22fc5661badc9744eaa0def627a96dbc76313c6d34b19a7ef8c52561060a14",
                "md5": "c8d2def10a410818e477e90820b32ba8",
                "sha256": "2424f65dc50f829334383292aa42023c38801519d00bebe004d908c1c349e9ab"
            },
            "downloads": -1,
            "filename": "pyauto_dotenv-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c8d2def10a410818e477e90820b32ba8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5836,
            "upload_time": "2024-03-09T14:48:31",
            "upload_time_iso_8601": "2024-03-09T14:48:31.541507Z",
            "url": "https://files.pythonhosted.org/packages/1b/22/fc5661badc9744eaa0def627a96dbc76313c6d34b19a7ef8c52561060a14/pyauto_dotenv-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-09 14:48:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hmiladhia",
    "github_project": "auto-dotenv",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyauto-dotenv"
}
        
Elapsed time: 2.84994s