{ "info": { "author": "Yipit Coders", "author_email": "coders@yipitdata.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development" ], "description": "A helping hand to manage your settings among different environments\n\n## Intro\n\nManaging application configuration that runs on multiple environments\ncan be tough. So, **envelop** comes to help you pretend you have only one\nsettings file that magically works whenever you deploy.\n\nHere at Yipit, we use Chef to coordinate the deploy process and to maintain the\nconfiguration, using attributes or data bags.\n\nAfter that, we use [envdir](http://cr.yp.to/daemontools/envdir.html)\nto run our applications with variables set in Chef. Then, we use\n**envelop** to read those variables and feed the application configuration\nsystem.\n\n## Production\n\nThe system environment is the first place **envelop** will try to find\nthings. So, when the application runs inside of an environment with the right\nvariables set, it will just work.\n\nSo, if you know you have environment variables\n`DATABASE_URI` and `ALLOWED_IPS` like this:\n\n```bash\n$ export DATABASE_URI=mysql://root@localhost:3306/mydb\n$ export ALLOWED_IPS=10.0.0.1,10.0.0.2\n```\n\nThe application settings glue code will look like this:\n\n```python\n>>> from envelop import Environment\n>>> env = Environment()\n>>> dburi = env.get_uri('DATABASE_URI')\n>>> dburi.host\nu'localhost'\n>>> dburi.port\n3306\n>>> env.get_list('ALLOWED_IPS')\n['10.0.0.1', '10.0.0.2']\n```\n\n## Local\n\nIf you just want to load things from a file locally, the\n`Environment.from_file()` constructor will help you out.\n\n```python\n>>> from envelop import Environment\n>>> env = Environment.from_file('/etc/app.cfg')\n>>> env.get_bool('BOOL_FLAG')\nTrue\n>>> env.get_float('FLOAT_VAL')\n3.14\n```\n\nThe file `app.cfg` will look like this:\n\n```yaml\nBOOL_FLAG: True\n\nFLOAT_VAL: 3.14\n```\n\n## From a folder\n\nYou can also load variables from a folder, where each file will be an\nenvironment variable and the file's content will be the value. Just like\n[envdir](http://cr.yp.to/daemontools/envdir.html).\n\nNow, say that you have the folder `/etc/envdir/app` and this folder contains\nthe file `MYSQL_CONN_URI` with a database URL inside of it. Just like this one\nhere: `mysql://root:secret@localhost:3306/mydb`.\n\nTo read that directory and load the variable properly, you just have to do the\nfollowing:\n\n```python\n>>> from envelop import Environment\n>>> env = Environment.from_folder('/etc/envdir/app')\n>>> uri = env.get_uri('MYSQL_CONN_URI')\n>>> uri.host\n'localhost'\n>>> uri.port\n3306\n>>> uri.user\n'root'\n>>> uri.password\n'secret'\n```\n\n# Hacking on it\n\n## Install dev dependencies\n\n```console\npip install -r requirements-dev.txt\n```\n\n## Run tests\n\n```console\nmake test\n```\n\n## Change it\n\nMake sure you write tests for your new features and keep the test coverage in 100%\n\n## Release it\n\nAfter you already made your commits, run:\n\n```console\nmake release\n```\n\nfollow the instructions and do the [harlem shake](http://www.youtube.com/watch?v=8vJiSSAMNWw)\n\n\n## Project history\n\nThis project was started by [Lincoln de Sousa](https://github.com/clarete) and was called [\"Milieu\"](https://github.com/clarete/milieu). We renamed it to \"Envelop\" on May 21st, 2014.", "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/Yipit/envelop", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "envelop", "package_url": "https://pypi.org/project/envelop/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/envelop/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Yipit/envelop" }, "release_url": "https://pypi.org/project/envelop/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "A helping hand to manage your settings among different environments", "version": "0.3.0" }, "last_serial": 2960488, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "02609bd89a830f1741913c40aadf85fd", "sha256": "d9584b0106f3b6c32f5f0b7406da44b9f0a273a6b741c52f0875156cf98acd5b" }, "downloads": -1, "filename": "envelop-0.2.0.tar.gz", "has_sig": false, "md5_digest": "02609bd89a830f1741913c40aadf85fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8413, "upload_time": "2014-05-21T21:18:27", "url": "https://files.pythonhosted.org/packages/62/49/df0210c438b75b3bd040f7f9ac11fed322e3ebddd359e37918914e49987f/envelop-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "46ee9c075311de25e471b397bb488428", "sha256": "23cb77e497ab5cd9050a02d79986be1863856e21d96285da60a223727f6b4978" }, "downloads": -1, "filename": "envelop-0.3.0.tar.gz", "has_sig": false, "md5_digest": "46ee9c075311de25e471b397bb488428", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9119, "upload_time": "2017-06-19T20:06:56", "url": "https://files.pythonhosted.org/packages/c8/c4/f131ad80f30154930747b7126da48d51de3c45a46a0e9b5aeb21319dab29/envelop-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "46ee9c075311de25e471b397bb488428", "sha256": "23cb77e497ab5cd9050a02d79986be1863856e21d96285da60a223727f6b4978" }, "downloads": -1, "filename": "envelop-0.3.0.tar.gz", "has_sig": false, "md5_digest": "46ee9c075311de25e471b397bb488428", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9119, "upload_time": "2017-06-19T20:06:56", "url": "https://files.pythonhosted.org/packages/c8/c4/f131ad80f30154930747b7126da48d51de3c45a46a0e9b5aeb21319dab29/envelop-0.3.0.tar.gz" } ] }