env-tools


Nameenv-tools JSON
Version 2.4.0 PyPI version JSON
download
home_pagehttps://github.com/beaugunderson/python-env-tools
SummaryTools for using .env files in Python
upload_time2024-12-04 22:36:59
maintainerNone
docs_urlNone
authorBeau Gunderson
requires_pythonNone
licenseMIT
keywords .env env heroku procfile foreman
VCS
bugtrack_url
requirements configparser six tini
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## env-tools

A simple module for loading and applying .env files.

Works in Python 2 and Python 3.

### Running tests

```bash
$ py.test
```

Or, with `tox` (test with multiple Python versions):

```bash
$ tox
```

### Example

#### .env

```bash
VARIABLE_A=123
VARIABLE_B="testing, testing"
```

#### example.py

```python
import os

from env_tools import apply_env

# loads '.env' by default, to load another file use
# apply_env(load_env('filename'))
apply_env()

assert os.environ['VARIABLE_A'] == '123'
assert os.environ['VARIABLE_B'] == 'testing, testing'
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/beaugunderson/python-env-tools",
    "name": "env-tools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": ".env env heroku procfile foreman",
    "author": "Beau Gunderson",
    "author_email": "beau@beaugunderson.com",
    "download_url": "https://files.pythonhosted.org/packages/fc/fe/6e1f798aad787e15105c61236bf3f201a1408a2bf067d6962545e5c2f974/env_tools-2.4.0.tar.gz",
    "platform": null,
    "description": "## env-tools\n\nA simple module for loading and applying .env files.\n\nWorks in Python 2 and Python 3.\n\n### Running tests\n\n```bash\n$ py.test\n```\n\nOr, with `tox` (test with multiple Python versions):\n\n```bash\n$ tox\n```\n\n### Example\n\n#### .env\n\n```bash\nVARIABLE_A=123\nVARIABLE_B=\"testing, testing\"\n```\n\n#### example.py\n\n```python\nimport os\n\nfrom env_tools import apply_env\n\n# loads '.env' by default, to load another file use\n# apply_env(load_env('filename'))\napply_env()\n\nassert os.environ['VARIABLE_A'] == '123'\nassert os.environ['VARIABLE_B'] == 'testing, testing'\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Tools for using .env files in Python",
    "version": "2.4.0",
    "project_urls": {
        "Homepage": "https://github.com/beaugunderson/python-env-tools"
    },
    "split_keywords": [
        ".env",
        "env",
        "heroku",
        "procfile",
        "foreman"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "80d28c9b21a7c8e8195105baef25f5f50bdfd41dbae318004244939484485d73",
                "md5": "92f581327102a5abc2838626b9ec72fc",
                "sha256": "3a927635eef0fa32ff33e89b244519b3e924227ba372d46f6f32629faf5c404f"
            },
            "downloads": -1,
            "filename": "env_tools-2.4.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "92f581327102a5abc2838626b9ec72fc",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 2700,
            "upload_time": "2024-12-04T22:36:58",
            "upload_time_iso_8601": "2024-12-04T22:36:58.292260Z",
            "url": "https://files.pythonhosted.org/packages/80/d2/8c9b21a7c8e8195105baef25f5f50bdfd41dbae318004244939484485d73/env_tools-2.4.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fcfe6e1f798aad787e15105c61236bf3f201a1408a2bf067d6962545e5c2f974",
                "md5": "c375e7a2a2ce28f3071591bc45bff7a5",
                "sha256": "5979fb0486d428e0659865335385990f9776f27b05346dcdcfbd290ab9ff9b4a"
            },
            "downloads": -1,
            "filename": "env_tools-2.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c375e7a2a2ce28f3071591bc45bff7a5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2885,
            "upload_time": "2024-12-04T22:36:59",
            "upload_time_iso_8601": "2024-12-04T22:36:59.405494Z",
            "url": "https://files.pythonhosted.org/packages/fc/fe/6e1f798aad787e15105c61236bf3f201a1408a2bf067d6962545e5c2f974/env_tools-2.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-04 22:36:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "beaugunderson",
    "github_project": "python-env-tools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "configparser",
            "specs": [
                [
                    "==",
                    "3.5.0"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.11.0"
                ]
            ]
        },
        {
            "name": "tini",
            "specs": [
                [
                    "==",
                    "3.0.1"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "env-tools"
}
        
Elapsed time: 0.43580s