env-should-be


Nameenv-should-be JSON
Version 0.2.7 PyPI version JSON
download
home_pagehttps://github.com/wassef911/env_should_be
SummaryShip Secure and Streamlined Multi-Environment Specification.
upload_time2023-09-06 17:10:20
maintainer
docs_urlNone
authorWassef911
requires_python>=3.11.4
license
keywords python3 pypi package
VCS
bugtrack_url
requirements bleach cachetools certifi cffi cfgv chardet charset-normalizer click colorama cryptography distlib docutils filelock identify idna importlib-metadata jaraco.classes jeepney keyring markdown-it-py mdurl more-itertools nodeenv packaging Pillow pkginfo platformdirs pluggy pre-commit pycparser Pygments pypandoc pyproject-api PyYAML readme-renderer requests requests-toolbelt rfc3986 rich SecretStorage six svgwrite tox Tree twine urllib3 virtualenv webencodings zipp
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![cover](https://raw.githubusercontent.com/wassef911/env_should_be/master/cover.png)

[click to read first article about this package](https://dev.to/wassef911/ship-slightly-better-microservices-4i1m)

[latest version on pypi](https://pypi.org/project/env-should-be/)

a more efficient, automated, and developer-friendly approach, allowing them to define deployment environment requirements using simple JSON or YAML descriptions.

Specify the exact conditions under which a container can run, mitigating compatibility issues and enforcing security standards seamlessly…

This environment description can either be one or multiple files and can also be a combination for each type of environment…

```sh
$ pip install env_should_be

env_should_be -fs --description /path/to/description/db.yml /path/to/description/app.json --env-file /path/to/.env --callback ./notify_admin.bash
```

# examples

a number of example should be available [under this link](https://github.com/wassef911/env_should_be/tree/master/examples)

or just do a

```sh

env_should_be --help

env_should_be [-h] -d DESCRIPTION [DESCRIPTION ...] [-fs FAIL_SILENTLY] [-e ENV_FILE] [-cb CALLBACK]

How should your environment be?

options:
  -d DESCRIPTION [DESCRIPTION ...], --description DESCRIPTION [DESCRIPTION ...]
                        <Required> either one or multiple paths for description files. (json/yml)

  -fs FAIL_SILENTLY, --fail-silently FAIL_SILENTLY
                        <Optional> will return an exit status of 0 even if the description(s) fail to match the current env (still triggers the callback).

  -e ENV_FILE, --env-file ENV_FILE
                        <Optional> not specifying a path to a specific env file to validate description(s) against, environment variables in the current shell will be loaded instead.

  -cb CALLBACK, --callback CALLBACK
                        <Optional> a callback script to be executed an environment fails to match the a description. (still triggered on fail-silently)
```

## full list of possible descriptions:

```py
(
  "boolean",
  "length",
  "min_length",
  "max_length",
  "regex",
  "option",
  "constant",
  "is_int",
  "is_str",
  "is_float",
  "is_number",
  "is_greater_than_eq",
  "is_lower_than_eq",
  "is_http",
  "is_https",
  "is_ipv4",
  "is_ipv6",
  "is_email",
  "is_uuid",
)
```

### TODOs:

- [x] better exceptions
- [x] support required arg
- [x] support callbacks
- [x] example Dockerfiles for different base images (only flask for now)
- [x] a more helpful readme
- [ ] collect/open issues
- [x] support older python versions
- [x] support different/more complex descriptions
- [ ] support setting default values
- [ ] ship a single executable ?

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wassef911/env_should_be",
    "name": "env-should-be",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11.4",
    "maintainer_email": "",
    "keywords": "python3,pypi,package",
    "author": "Wassef911",
    "author_email": "wassef911@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d7/f0/3137c20ae99d7c503ae0f3929d80cd1764a67bb903ddf25fe795c9d86a80/env_should_be-0.2.7.tar.gz",
    "platform": null,
    "description": "![cover](https://raw.githubusercontent.com/wassef911/env_should_be/master/cover.png)\n\n[click to read first article about this package](https://dev.to/wassef911/ship-slightly-better-microservices-4i1m)\n\n[latest version on pypi](https://pypi.org/project/env-should-be/)\n\na more efficient, automated, and developer-friendly approach, allowing them to define deployment environment requirements using simple JSON or YAML descriptions.\n\nSpecify the exact conditions under which a container can run, mitigating compatibility issues and enforcing security standards seamlessly\u2026\n\nThis environment description can either be one or multiple files and can also be a combination for each type of environment\u2026\n\n```sh\n$ pip install env_should_be\n\nenv_should_be -fs --description /path/to/description/db.yml /path/to/description/app.json --env-file /path/to/.env --callback ./notify_admin.bash\n```\n\n# examples\n\na number of example should be available [under this link](https://github.com/wassef911/env_should_be/tree/master/examples)\n\nor just do a\n\n```sh\n\nenv_should_be --help\n\nenv_should_be [-h] -d DESCRIPTION [DESCRIPTION ...] [-fs FAIL_SILENTLY] [-e ENV_FILE] [-cb CALLBACK]\n\nHow should your environment be?\n\noptions:\n  -d DESCRIPTION [DESCRIPTION ...], --description DESCRIPTION [DESCRIPTION ...]\n                        <Required> either one or multiple paths for description files. (json/yml)\n\n  -fs FAIL_SILENTLY, --fail-silently FAIL_SILENTLY\n                        <Optional> will return an exit status of 0 even if the description(s) fail to match the current env (still triggers the callback).\n\n  -e ENV_FILE, --env-file ENV_FILE\n                        <Optional> not specifying a path to a specific env file to validate description(s) against, environment variables in the current shell will be loaded instead.\n\n  -cb CALLBACK, --callback CALLBACK\n                        <Optional> a callback script to be executed an environment fails to match the a description. (still triggered on fail-silently)\n```\n\n## full list of possible descriptions:\n\n```py\n(\n  \"boolean\",\n  \"length\",\n  \"min_length\",\n  \"max_length\",\n  \"regex\",\n  \"option\",\n  \"constant\",\n  \"is_int\",\n  \"is_str\",\n  \"is_float\",\n  \"is_number\",\n  \"is_greater_than_eq\",\n  \"is_lower_than_eq\",\n  \"is_http\",\n  \"is_https\",\n  \"is_ipv4\",\n  \"is_ipv6\",\n  \"is_email\",\n  \"is_uuid\",\n)\n```\n\n### TODOs:\n\n- [x] better exceptions\n- [x] support required arg\n- [x] support callbacks\n- [x] example Dockerfiles for different base images (only flask for now)\n- [x] a more helpful readme\n- [ ] collect/open issues\n- [x] support older python versions\n- [x] support different/more complex descriptions\n- [ ] support setting default values\n- [ ] ship a single executable ?\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Ship Secure and Streamlined Multi-Environment Specification.",
    "version": "0.2.7",
    "project_urls": {
        "Homepage": "https://github.com/wassef911/env_should_be"
    },
    "split_keywords": [
        "python3",
        "pypi",
        "package"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3463425f34d15fc0eefaa4bf079ca7b5c244b0bbce4d5cd28f01b295219e1d73",
                "md5": "ae8214888aab6d0707884c0ee106a941",
                "sha256": "b82199a6249bdeb7bf5a779b8ac0dcc0b4068297b6b401fadbac6118d707a4a6"
            },
            "downloads": -1,
            "filename": "env_should_be-0.2.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ae8214888aab6d0707884c0ee106a941",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11.4",
            "size": 8496,
            "upload_time": "2023-09-06T17:10:16",
            "upload_time_iso_8601": "2023-09-06T17:10:16.176165Z",
            "url": "https://files.pythonhosted.org/packages/34/63/425f34d15fc0eefaa4bf079ca7b5c244b0bbce4d5cd28f01b295219e1d73/env_should_be-0.2.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d7f03137c20ae99d7c503ae0f3929d80cd1764a67bb903ddf25fe795c9d86a80",
                "md5": "826f0eed1ebd2abc4b91a59fd96d5d5b",
                "sha256": "aec0163cf41584aed665496490d5427741d8ec82388e36f164f2c28edf079f82"
            },
            "downloads": -1,
            "filename": "env_should_be-0.2.7.tar.gz",
            "has_sig": false,
            "md5_digest": "826f0eed1ebd2abc4b91a59fd96d5d5b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11.4",
            "size": 416466,
            "upload_time": "2023-09-06T17:10:20",
            "upload_time_iso_8601": "2023-09-06T17:10:20.181406Z",
            "url": "https://files.pythonhosted.org/packages/d7/f0/3137c20ae99d7c503ae0f3929d80cd1764a67bb903ddf25fe795c9d86a80/env_should_be-0.2.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-06 17:10:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wassef911",
    "github_project": "env_should_be",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "bleach",
            "specs": [
                [
                    "==",
                    "6.0.0"
                ]
            ]
        },
        {
            "name": "cachetools",
            "specs": [
                [
                    "==",
                    "5.3.1"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2023.7.22"
                ]
            ]
        },
        {
            "name": "cffi",
            "specs": [
                [
                    "==",
                    "1.15.1"
                ]
            ]
        },
        {
            "name": "cfgv",
            "specs": [
                [
                    "==",
                    "3.4.0"
                ]
            ]
        },
        {
            "name": "chardet",
            "specs": [
                [
                    "==",
                    "5.2.0"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "3.2.0"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.7"
                ]
            ]
        },
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.6"
                ]
            ]
        },
        {
            "name": "cryptography",
            "specs": [
                [
                    "==",
                    "41.0.3"
                ]
            ]
        },
        {
            "name": "distlib",
            "specs": [
                [
                    "==",
                    "0.3.7"
                ]
            ]
        },
        {
            "name": "docutils",
            "specs": [
                [
                    "==",
                    "0.20.1"
                ]
            ]
        },
        {
            "name": "filelock",
            "specs": [
                [
                    "==",
                    "3.12.3"
                ]
            ]
        },
        {
            "name": "identify",
            "specs": [
                [
                    "==",
                    "2.5.27"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.4"
                ]
            ]
        },
        {
            "name": "importlib-metadata",
            "specs": [
                [
                    "==",
                    "6.8.0"
                ]
            ]
        },
        {
            "name": "jaraco.classes",
            "specs": [
                [
                    "==",
                    "3.3.0"
                ]
            ]
        },
        {
            "name": "jeepney",
            "specs": [
                [
                    "==",
                    "0.8.0"
                ]
            ]
        },
        {
            "name": "keyring",
            "specs": [
                [
                    "==",
                    "24.2.0"
                ]
            ]
        },
        {
            "name": "markdown-it-py",
            "specs": [
                [
                    "==",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "mdurl",
            "specs": [
                [
                    "==",
                    "0.1.2"
                ]
            ]
        },
        {
            "name": "more-itertools",
            "specs": [
                [
                    "==",
                    "10.1.0"
                ]
            ]
        },
        {
            "name": "nodeenv",
            "specs": [
                [
                    "==",
                    "1.8.0"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "23.1"
                ]
            ]
        },
        {
            "name": "Pillow",
            "specs": [
                [
                    "==",
                    "10.0.0"
                ]
            ]
        },
        {
            "name": "pkginfo",
            "specs": [
                [
                    "==",
                    "1.9.6"
                ]
            ]
        },
        {
            "name": "platformdirs",
            "specs": [
                [
                    "==",
                    "3.10.0"
                ]
            ]
        },
        {
            "name": "pluggy",
            "specs": [
                [
                    "==",
                    "1.3.0"
                ]
            ]
        },
        {
            "name": "pre-commit",
            "specs": [
                [
                    "==",
                    "3.0.1"
                ]
            ]
        },
        {
            "name": "pycparser",
            "specs": [
                [
                    "==",
                    "2.21"
                ]
            ]
        },
        {
            "name": "Pygments",
            "specs": [
                [
                    "==",
                    "2.16.1"
                ]
            ]
        },
        {
            "name": "pypandoc",
            "specs": [
                [
                    "==",
                    "1.11"
                ]
            ]
        },
        {
            "name": "pyproject-api",
            "specs": [
                [
                    "==",
                    "1.5.4"
                ]
            ]
        },
        {
            "name": "PyYAML",
            "specs": [
                [
                    "==",
                    "6.0.1"
                ]
            ]
        },
        {
            "name": "readme-renderer",
            "specs": [
                [
                    "==",
                    "41.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.31.0"
                ]
            ]
        },
        {
            "name": "requests-toolbelt",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "rfc3986",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    "==",
                    "13.5.2"
                ]
            ]
        },
        {
            "name": "SecretStorage",
            "specs": [
                [
                    "==",
                    "3.3.3"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "svgwrite",
            "specs": [
                [
                    "==",
                    "1.4.3"
                ]
            ]
        },
        {
            "name": "tox",
            "specs": [
                [
                    "==",
                    "4.10.0"
                ]
            ]
        },
        {
            "name": "Tree",
            "specs": [
                [
                    "==",
                    "0.2.4"
                ]
            ]
        },
        {
            "name": "twine",
            "specs": [
                [
                    "==",
                    "4.0.2"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "2.0.4"
                ]
            ]
        },
        {
            "name": "virtualenv",
            "specs": [
                [
                    "==",
                    "20.24.3"
                ]
            ]
        },
        {
            "name": "webencodings",
            "specs": [
                [
                    "==",
                    "0.5.1"
                ]
            ]
        },
        {
            "name": "zipp",
            "specs": [
                [
                    "==",
                    "3.16.2"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "env-should-be"
}
        
Elapsed time: 0.11374s