enviscerate


Nameenviscerate JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummaryAccess env variables by one line declaration with automatic typecasting
upload_time2023-11-28 18:35:04
maintainer
docs_urlNone
author
requires_python>=3.6
licenseMIT
keywords dotenv env vars environment shell bash
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ENViscerate

One line access to environment variables, handling typecasts automatically. Simply declare a variable with the same name, assigning it to the output of the function ``env(default_value)`` where ``default_value`` is of the type you want the env variable casted as. It is easier to say with an example

```python
from enviscerate import env
HOME = env('/this/dir')
```

Will set the value of HOME with the following precedence 

1. env var ``$HOME``
2. .env file supplied value
3. value ``'/this/dir'`` you supplied to env() function above


features
--------

- if type is dict, it will be parsed as JSLOB using jsonofabitch module(if available). parsed as JSON using builtin json.loads() otherwise
- if bool it will be set to ``True`` if ``str(val).lower() in ["t", "true", "1", "yes", "y"]`` for ``env(val)`` and ``False`` otherwise
- If ``None``, the case of ``env()``, you will get ``None`` if the variable is not declared and a string otherwise
- otherwise it will be casted as whatever you supply. presumably an ``int`` ``float`` or ``str`` but with no presumptions or restrictions thereof
- It will use dotenv if available but does not require it, but will spit warnings to avoid frustrating mysterious why-are-my-settings-not-registering hickups


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "enviscerate",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "dotenv,env,vars,environment,shell,bash",
    "author": "",
    "author_email": "c mark0v <cmark0v@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/39/b9/04f23d8a9efad8f35fc5c14ec66d4fc43e92acde188cc9b3dbc6b1964ec0/enviscerate-0.0.1.tar.gz",
    "platform": null,
    "description": "# ENViscerate\n\nOne line access to environment variables, handling typecasts automatically. Simply declare a variable with the same name, assigning it to the output of the function ``env(default_value)`` where ``default_value`` is of the type you want the env variable casted as. It is easier to say with an example\n\n```python\nfrom enviscerate import env\nHOME = env('/this/dir')\n```\n\nWill set the value of HOME with the following precedence \n\n1. env var ``$HOME``\n2. .env file supplied value\n3. value ``'/this/dir'`` you supplied to env() function above\n\n\nfeatures\n--------\n\n- if type is dict, it will be parsed as JSLOB using jsonofabitch module(if available). parsed as JSON using builtin json.loads() otherwise\n- if bool it will be set to ``True`` if ``str(val).lower() in [\"t\", \"true\", \"1\", \"yes\", \"y\"]`` for ``env(val)`` and ``False`` otherwise\n- If ``None``, the case of ``env()``, you will get ``None`` if the variable is not declared and a string otherwise\n- otherwise it will be casted as whatever you supply. presumably an ``int`` ``float`` or ``str`` but with no presumptions or restrictions thereof\n- It will use dotenv if available but does not require it, but will spit warnings to avoid frustrating mysterious why-are-my-settings-not-registering hickups\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Access env variables by one line declaration with automatic typecasting",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/cmark0v/enviscerate"
    },
    "split_keywords": [
        "dotenv",
        "env",
        "vars",
        "environment",
        "shell",
        "bash"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e2b91ba9bec41d891a0b3e041e53094dabcc6ae5b77e4ffd2c4425c3fe304e2b",
                "md5": "cf719d12b137054d34ede467a2dbeb78",
                "sha256": "b18f046dc8f0e79ff1ef19cd3c0e21cae0347238bcd56b081b12d47bb16fc02f"
            },
            "downloads": -1,
            "filename": "enviscerate-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cf719d12b137054d34ede467a2dbeb78",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 3345,
            "upload_time": "2023-11-28T18:34:55",
            "upload_time_iso_8601": "2023-11-28T18:34:55.782643Z",
            "url": "https://files.pythonhosted.org/packages/e2/b9/1ba9bec41d891a0b3e041e53094dabcc6ae5b77e4ffd2c4425c3fe304e2b/enviscerate-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39b904f23d8a9efad8f35fc5c14ec66d4fc43e92acde188cc9b3dbc6b1964ec0",
                "md5": "2ebf5e6df666b3bbc472baf556f35f47",
                "sha256": "1404177d1495845eaadc5e11878bcee1ec68454bd2531cc63bf7ae3918fbda46"
            },
            "downloads": -1,
            "filename": "enviscerate-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2ebf5e6df666b3bbc472baf556f35f47",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 2754,
            "upload_time": "2023-11-28T18:35:04",
            "upload_time_iso_8601": "2023-11-28T18:35:04.148604Z",
            "url": "https://files.pythonhosted.org/packages/39/b9/04f23d8a9efad8f35fc5c14ec66d4fc43e92acde188cc9b3dbc6b1964ec0/enviscerate-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-28 18:35:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cmark0v",
    "github_project": "enviscerate",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "enviscerate"
}
        
Elapsed time: 0.14391s