{ "info": { "author": "Zalando SE", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "environmental\n=============\n\n.. image:: https://travis-ci.org/zalando/environmental.svg?branch=master\n :target: https://travis-ci.org/zalando/environmental\n :alt: Build Status\n\n\n.. image:: https://coveralls.io/repos/zalando/environmental/badge.svg?branch=master\n :target: https://coveralls.io/r/zalando/environmental?branch=master\n :alt: Code Coverage\n\n.. image:: https://img.shields.io/pypi/v/environmental.svg\n :target: https://pypi.python.org/pypi/environmental\n :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/status/environmental.svg\n :target: https://pypi.python.org/pypi/environmental\n :alt: Development Status\n\n.. image:: https://img.shields.io/pypi/l/environmental.svg\n :target: https://github.com/zalando/environmental/blob/master/LICENSE\n :alt: License\n\n\nMap a python configuration from environment variables.\n\nOverview\n--------\n**environmental** allows you to map class properties to environment variables.\n\nBy using **environmental** you can keep your configuration in a single class your IDE understands and have convenient\nand safe type conversions between the strings stored in your environment and python types.\n\nThe created properties are also writable so if you assign to them they will change on your environment and will be\navailable to your child processes.\n\nInstallation\n------------\n\n.. code-block:: bash\n\n $ sudo pip3 install --upgrade environmental\n\nExample\n-------\n\n.. code-block:: python\n\n import environmental\n import os\n\n class Configuration:\n port = environmental.Int('MY_APPLICATION_HTTP_PORT', 80)\n name = environmental.Str('MY_APPLICATION_NAME', 'Name')\n\n config = Configuration()\n config.port = 8080\n assert os.environ['MY_APPLICATION_HTTP_PORT'] == '8080'\n assert isinstance(os.environ['MY_APPLICATION_HTTP_PORT'], str)\n assert config.port == 8080\n assert isinstance(config.port, int)\n\n\nCaveats\n-------\nModifying mutable objects in the configuration (like lists) will not work:\n\n.. code-block:: python\n\n import os, environmental\n class Configuration:\n list = environmental.List('LIST')\n\n os.environ['LIST'] = \"[]\"\n assert config.list == []\n config.list.append('test')\n assert config.list == []\n\nBut doing something that reassigns the variable will:\n\n.. code-block:: python\n\n config.list += ['test']\n assert config.list == ['test']\n\nLicense\n-------\nCopyright 2015 Zalando SE\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/zalando/environmental", "keywords": null, "license": "Apache License Version 2.0", "maintainer": null, "maintainer_email": null, "name": "environmental", "package_url": "https://pypi.org/project/environmental/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/environmental/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/zalando/environmental" }, "release_url": "https://pypi.org/project/environmental/1.3/", "requires_dist": null, "requires_python": null, "summary": "Map a python configuration from environment variables", "version": "1.3" }, "last_serial": 1902724, "releases": { "0": [ { "comment_text": "", "digests": { "md5": "2168a9b57773ddc687e7af99d4ea7ef7", "sha256": "a359cca72adf98a773644f8e9c26195532ee7ece4da03de0e853ba42f4f37cb6" }, "downloads": -1, "filename": "environmental-0.tar.gz", "has_sig": false, "md5_digest": "2168a9b57773ddc687e7af99d4ea7ef7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1653, "upload_time": "2015-05-12T14:17:36", "url": "https://files.pythonhosted.org/packages/ad/55/4dcf5f3586fb23101a6b027b9b66aa8f4327e84f4094196f96d3c329c20e/environmental-0.tar.gz" } ], "0.20150515073149": [ { "comment_text": "", "digests": { "md5": "c853a24976c0307f9a284ae753bd764c", "sha256": "84f8e7f02e03cd8e2e791851b759979a9bf3959a8ec53c58cdc3707376e7a52e" }, "downloads": -1, "filename": "environmental-0.20150515073149.tar.gz", "has_sig": false, "md5_digest": "c853a24976c0307f9a284ae753bd764c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3015, "upload_time": "2015-05-15T07:31:52", "url": "https://files.pythonhosted.org/packages/c7/77/7c29b96f8360bf82509324afb41e215c479f17cc871908b04fd2f4097dae/environmental-0.20150515073149.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "338a949e09f448d9fac132c087206d84", "sha256": "9d92ceb69101f8ae7d9b3d160dfe7ea95a6dd4c0576c6574c650f1691fed459a" }, "downloads": -1, "filename": "environmental-1.0.tar.gz", "has_sig": false, "md5_digest": "338a949e09f448d9fac132c087206d84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3192, "upload_time": "2015-05-15T09:45:57", "url": "https://files.pythonhosted.org/packages/7e/cc/8d0a604b016afaafb38743cfefa1a90bcd39d6032bff34b156dc2ff1c9cb/environmental-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "bc3d3e65b6fb13df922ccd6d38b2c2dd", "sha256": "b73072a8c6b3506ebb2dc1425ea7d39a9e7a5aa884196f4d8ef66171aed4f6ca" }, "downloads": -1, "filename": "environmental-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "bc3d3e65b6fb13df922ccd6d38b2c2dd", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 6039, "upload_time": "2015-10-05T07:15:57", "url": "https://files.pythonhosted.org/packages/ba/f0/33d9ff2272cb3958f3cfd31ab01633364a5d94756b1642f9db86c38ccf52/environmental-1.1-py3-none-any.whl" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "76c575cd1b642b33e31fbdacdc358842", "sha256": "6b41b58c68068f6aee146042005edb2c9d553e0f9fbfd4dfcb3a3a996fc06b8f" }, "downloads": -1, "filename": "environmental-1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "76c575cd1b642b33e31fbdacdc358842", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 11281, "upload_time": "2015-10-28T10:27:02", "url": "https://files.pythonhosted.org/packages/4f/f0/69adfe593373dfe7518a675382fc91a4eba85a5ae7a738867c92462228b8/environmental-1.2-py2.py3-none-any.whl" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "c7965187615b462bea2009884f5c6ff7", "sha256": "e2612bb4d98c303a5201648d0dce155d70051e553629a22355ebd21111466ba9" }, "downloads": -1, "filename": "environmental-1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "c7965187615b462bea2009884f5c6ff7", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 5935, "upload_time": "2016-01-13T14:43:03", "url": "https://files.pythonhosted.org/packages/cf/16/8a21714d5278fc8916255b1b10e4f49ebf5caffe8296a40886000a99903b/environmental-1.3-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c7965187615b462bea2009884f5c6ff7", "sha256": "e2612bb4d98c303a5201648d0dce155d70051e553629a22355ebd21111466ba9" }, "downloads": -1, "filename": "environmental-1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "c7965187615b462bea2009884f5c6ff7", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 5935, "upload_time": "2016-01-13T14:43:03", "url": "https://files.pythonhosted.org/packages/cf/16/8a21714d5278fc8916255b1b10e4f49ebf5caffe8296a40886000a99903b/environmental-1.3-py3-none-any.whl" } ] }