{ "info": { "author": "ebarajas", "author_email": "ebarajas@talroo.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only" ], "description": "# ps-environ\n\n## Description\nThis is a simple wrapper around AWS SSM Parameter Store. It is designed to cache and parse variables from Parameter Store for a specific service and stage.\nIt is heavily inspired by [django-environ](https://github.com/joke2k/django-environ) and shares a (simplified) interface.\n\nFor more on Parameter Store, read the [AWS documentation](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html).\n\n## Installation\n\nInstall with `pip`:\n\n``` bash\npip install parameter-store-environ \n```\n\n## Usage\nThe wrapper assumes that variables in parameter store are in the following format:\n`///`\n\nSo, for example:\n```\n/api/dev/DEBUG\n/api/prod/DB_HOST\n```\n\nThe wrapper is agnostic to the variable name, but we recommend you follow the convention for environment variables and use all caps and underscores. \n\nIn your settings/configuration module, import the module and create a new instance of the wrapper\n\n``` python\nfrom ps_environ import Env\nconfig = Env(service='api', stage='dev')\n\n# When called directly, the string value is returned\nassert config('DEBUG') == 'True'\n\n# Use casting methods to return the type you need\nassert config.bool('DEBUG') == True\n```\n\n### Schemas\nYou can define a schema when you instantiate the wrapper to avoid having to call the casting methods\n``` python\nconfig = Env(service='api', stage='dev', schema={\n 'DEBUG': bool,\n 'MAX_RETRIES': int,\n})\n\nassert config('DEBUG') == True\nassert config('MAX_RETRIES') == 5\n```\n\nSupported casting types: bool, float, int, set, list, tuple, json\n\nAdditional Notes:\n\n* `list, tuple, set`: These types expect the values to be separated by commas. E.g. `1,2,3`\n* `json`: A regular JSON string is expected. E.g. `{'foo': 'bar'}`\n\n### Environment Variable Override\nIf the variable is also set in the environment, that value will take precedence. \n\n### Default Values\nYou can set a default value by setting the default keyword.\nIf no default is set and the value is neither in the environment variables or in parameter store, an `ImproperlyConfigured` exception will be raised.\n``` python\nassert config('DB_HOST', default='localhost') == 'localhost'\n```\n\n## AWS Credentials\n`ps-environ` uses `boto3` to interface with parameter store and therefore uses the same mechanism for authentication.\nSee the [configuring credentials](https://boto3.readthedocs.io/en/latest/guide/configuration.html#configuring-credentials) in the Boto 3 documentation for more information.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/talroo/parameter-store-environ", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "parameter-store-environ", "package_url": "https://pypi.org/project/parameter-store-environ/", "platform": "", "project_url": "https://pypi.org/project/parameter-store-environ/", "project_urls": { "Homepage": "https://github.com/talroo/parameter-store-environ" }, "release_url": "https://pypi.org/project/parameter-store-environ/0.1.2/", "requires_dist": [ "boto3" ], "requires_python": ">=3.6.0", "summary": "A simple configuration variable wrapper around AWS SSM Parameter Store", "version": "0.1.2" }, "last_serial": 4927643, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "4dc886bdc2724d1965e70c3b22d30e73", "sha256": "6d50a9b54e759a4744ab082c49b6cd8f5db4ad6de094df547394ea3d195e1a10" }, "downloads": -1, "filename": "parameter_store_environ-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4dc886bdc2724d1965e70c3b22d30e73", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 4679, "upload_time": "2019-03-12T00:09:14", "url": "https://files.pythonhosted.org/packages/73/a6/32145eaccad310dd7603e2220c30fa8b49654d94002dc10e9d119759ecb9/parameter_store_environ-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f3871ef2bd3fc885629040ece741c164", "sha256": "eae9d193303f0f9ffa2f534b1625061ec0266d426076c9557d4843b44aef04b3" }, "downloads": -1, "filename": "parameter-store-environ-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f3871ef2bd3fc885629040ece741c164", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 4550, "upload_time": "2019-03-12T00:09:16", "url": "https://files.pythonhosted.org/packages/a8/0d/117fc878b15be937ba54b09db5eca442c4d74e48bb19e2bc43ecfeb60ca5/parameter-store-environ-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4dc886bdc2724d1965e70c3b22d30e73", "sha256": "6d50a9b54e759a4744ab082c49b6cd8f5db4ad6de094df547394ea3d195e1a10" }, "downloads": -1, "filename": "parameter_store_environ-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4dc886bdc2724d1965e70c3b22d30e73", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 4679, "upload_time": "2019-03-12T00:09:14", "url": "https://files.pythonhosted.org/packages/73/a6/32145eaccad310dd7603e2220c30fa8b49654d94002dc10e9d119759ecb9/parameter_store_environ-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f3871ef2bd3fc885629040ece741c164", "sha256": "eae9d193303f0f9ffa2f534b1625061ec0266d426076c9557d4843b44aef04b3" }, "downloads": -1, "filename": "parameter-store-environ-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f3871ef2bd3fc885629040ece741c164", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 4550, "upload_time": "2019-03-12T00:09:16", "url": "https://files.pythonhosted.org/packages/a8/0d/117fc878b15be937ba54b09db5eca442c4d74e48bb19e2bc43ecfeb60ca5/parameter-store-environ-0.1.2.tar.gz" } ] }