{ "info": { "author": "Aron Griffis", "author_email": "aron@scampersand.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "=========\nbienvenue\n=========\n\n|PyPI| |Build Status| |Coverage Report|\n\nPython module for reading config from environment for `12-factor apps `_.\nSupports Python 3.4+\n\nRationale\n---------\n\nIn a 12-factor app, `config comes from the environment `_.\nFor example, on Heroku, config variables are set using ``heroku config:set`` on the command line,\nthen `passed to the application in the environment `_.\n\nReading and parsing config from the environment is tedious and error-prone. For\nexample, a Django app has ``settings.DEBUG`` which should be\neither ``True`` or ``False``. The operator runs ``heroku config:set DJANGO_DEBUG\noff`` intending to disable it, but the application only sees a non-empty string\nand treats the value as ``True``.\n\nThis sort of problem can be handled case-by-case but doesn't need to be. Clearly\na configuration setting with a fallback boolean value should be interpreted as\nboolean from the environment. Likewise a fallback integer setting indicates the\nassociated environment variable should be converted from string to int.\n\nSounds like a job for a small and well-tested Python module, right?\n\nInstallation\n------------\n\nInstall from PyPI_:\n\n.. code:: sh\n\n pip install bienvenue\n\nUsage\n-----\n\nBienvenue provides the function ``make_env_reader`` which returns a new\nfunction for accessing the environment. For example:\n\n.. code:: python\n\n from bienvenue import make_env_reader\n\n env = make_env_reader(prefix='MY_')\n\n DEBUG = env('DEBUG', False)\n SECRET_KEY = env('SECRET_KEY', 'fallback-secret-for-dev')\n ALLOWED_HOSTS = env('ALLOWED_HOSTS', [])\n\nThe env reader looks for ``MY_DEBUG`` in ``os.environ``. If it's not there,\nthe default value ``False`` will be returned. However if it's found, then the\nvalue there will be interpreted according to the type of the default, in this\ncase boolean. Common strings such as on/off, true/false and yes/no are\ninterpreted into ``True`` or ``False``.\n\nLikewise ``SECRET_KEY`` will be extracted from ``MY_SECRET_KEY`` and then\ninterpreted as a string value.\n\n``ALLOWED_HOSTS`` will be extracted from ``MY_ALLOWED_HOSTS`` and JSON\ndecoded as a list, since the default value is a list.\n\nIf bienvenue encounters unknown types or values during parsing, it will log an\nerror and fall back to the provided default.\n\nLegal\n-----\n\nCopyright 2017 `Scampersand LLC `_\n\nReleased under the `MIT license `_\n\n.. _PyPI: https://pypi.python.org/pypi/bienvenue\n\n.. |Build Status| image:: https://img.shields.io/travis/scampersand/bienvenue/master.svg?style=plastic\n :target: https://travis-ci.org/scampersand/bienvenue?branch=master\n\n.. |Coverage Report| image:: https://img.shields.io/codecov/c/github/scampersand/bienvenue/master.svg?style=plastic\n :target: https://codecov.io/gh/scampersand/bienvenue/branch/master\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/bienvenue.svg?style=plastic\n :target: PyPI_\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/scampersand/bienvenue", "keywords": "django,environment,environ,env", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "bienvenue", "package_url": "https://pypi.org/project/bienvenue/", "platform": "", "project_url": "https://pypi.org/project/bienvenue/", "project_urls": { "Homepage": "https://github.com/scampersand/bienvenue" }, "release_url": "https://pypi.org/project/bienvenue/3.0.1/", "requires_dist": null, "requires_python": "", "summary": "Read config from environment for 12 factor apps", "version": "3.0.1" }, "last_serial": 4305319, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "ebd406532206fc1b0718859a925633c5", "sha256": "3e3109a957baa4457ad635573d7d963f319476bb729dc15ee3858368aa9a1e54" }, "downloads": -1, "filename": "bienvenue-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ebd406532206fc1b0718859a925633c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4829, "upload_time": "2017-01-30T15:30:43", "url": "https://files.pythonhosted.org/packages/dc/c7/3f9c41088560b2eefc7064dba108e787f38f29dd6ae5f2acf7fb102d6774/bienvenue-1.0.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "1ec8da78a6e886619cf5061cb5524895", "sha256": "2dd53675698acfd1ee556b6c9265416cff059203d373cdd6825b399b9c9b9748" }, "downloads": -1, "filename": "bienvenue-2.0.0.tar.gz", "has_sig": false, "md5_digest": "1ec8da78a6e886619cf5061cb5524895", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4897, "upload_time": "2017-01-30T21:13:42", "url": "https://files.pythonhosted.org/packages/d7/08/6e0b320886f9fdc0f7e014384b40efaaee081f86855541b9702b5769dadd/bienvenue-2.0.0.tar.gz" } ], "3.0.0": [ { "comment_text": "", "digests": { "md5": "370adfe8c4a7bfa43a44b861a6ec85c2", "sha256": "19286943819142a532fa5b8b0244d69cf661427b48af6b3605e4a93f9137cf5b" }, "downloads": -1, "filename": "bienvenue-3.0.0.tar.gz", "has_sig": false, "md5_digest": "370adfe8c4a7bfa43a44b861a6ec85c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4846, "upload_time": "2017-02-22T13:45:28", "url": "https://files.pythonhosted.org/packages/25/32/1655790133dd9475aabcd2b48563b88c911edc7dc2d29abd8c5aaeaf8bad/bienvenue-3.0.0.tar.gz" } ], "3.0.1": [ { "comment_text": "", "digests": { "md5": "c5c890ab14329e1287316a009d5e4024", "sha256": "e1b2232d64016414e67203855a805d30e7db969d3d72b7eb4f6b320174c14b2e" }, "downloads": -1, "filename": "bienvenue-3.0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "c5c890ab14329e1287316a009d5e4024", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7896, "upload_time": "2018-09-24T16:25:55", "url": "https://files.pythonhosted.org/packages/b4/0c/f9164f6430f6b12437205c02679bf065bdb069e0d64480ed452216c41e53/bienvenue-3.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b66ef4ffe4e4241b01976d156ecd0c12", "sha256": "9cafe50a37e9df8b4f31fcecccc9c36a7e939f7523da6cd860205d6b2afd4962" }, "downloads": -1, "filename": "bienvenue-3.0.1.tar.gz", "has_sig": true, "md5_digest": "b66ef4ffe4e4241b01976d156ecd0c12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4852, "upload_time": "2018-09-24T16:26:08", "url": "https://files.pythonhosted.org/packages/79/28/3ac12e1d5632c4f6f5523b4f6789eed93ed588591b98287f479b0dae8ca2/bienvenue-3.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c5c890ab14329e1287316a009d5e4024", "sha256": "e1b2232d64016414e67203855a805d30e7db969d3d72b7eb4f6b320174c14b2e" }, "downloads": -1, "filename": "bienvenue-3.0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "c5c890ab14329e1287316a009d5e4024", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7896, "upload_time": "2018-09-24T16:25:55", "url": "https://files.pythonhosted.org/packages/b4/0c/f9164f6430f6b12437205c02679bf065bdb069e0d64480ed452216c41e53/bienvenue-3.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b66ef4ffe4e4241b01976d156ecd0c12", "sha256": "9cafe50a37e9df8b4f31fcecccc9c36a7e939f7523da6cd860205d6b2afd4962" }, "downloads": -1, "filename": "bienvenue-3.0.1.tar.gz", "has_sig": true, "md5_digest": "b66ef4ffe4e4241b01976d156ecd0c12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4852, "upload_time": "2018-09-24T16:26:08", "url": "https://files.pythonhosted.org/packages/79/28/3ac12e1d5632c4f6f5523b4f6789eed93ed588591b98287f479b0dae8ca2/bienvenue-3.0.1.tar.gz" } ] }