{ "info": { "author": "Boris Tseitlin", "author_email": "btseytlin@start.film", "bugtrack_url": null, "classifiers": [], "description": "Comfortable python configs from environment variables.\n* Validated at **import time**. If you forgot a configuration variable you find out at startup.\n* One source of configuration for all application code. No more `flask_conf.cfg`, `myconfig.ini`, `.env`, hardcoded constants and variables from `docker-compose.yml`.\n* Type casting and validation at load time. Do it once and forget.\n\n# Quickstart\n```\n>>> from confy import BaseEnvironConfig\n>>> class Config(BaseEnvironConfig):\n... DEBUG = ConfigField(processor=strtobool, default=True)\n...\n>>> Config.DEBUG\nTrue\n```\n\nLoads variable `DEBUG` __at import time__ from environment, applies function `string_to_bool` to the value,\n\nIf variable is not provided uses the default of `True`.\n\n# Config field options\n* `default` - default value, can be anything\n* `required` - boolean, default `False`. Throws `ConfigError` if value is required, but not provided.\n* `processor` - callable. Can be used to validate the value\n* `from_var` - specify environment variable to take value from. If none uses config class property name, __case is important__.\n\n# Mocking in tests\nSince its a global class that can't be instanced it's __very important__ to import it like this:\n\n```\nfrom package import module\nprint(module.ConfigClass.as_text())\n```\n\nand __not__ like this:\n\n```\nfrom package.module import ConfigClass\nprint(ConfigClass.as_text())\n```\n\nThe first option allows you to monkey patch the config during testing.\nPytest example:\n\n```\nfrom package.module import ConfigClass\n\nclass TestConfig(ConfigClass):\n pass\n\nTestConfig.TEST = True\n\nmonkeypatch.setattr('package.module.ConfigClass', TestConfig)\n```\n\nAll code accesing `module.ConfigClass` will get `TestConfig`.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "configuration,env,docker", "license": "", "maintainer": "", "maintainer_email": "", "name": "confi", "package_url": "https://pypi.org/project/confi/", "platform": "", "project_url": "https://pypi.org/project/confi/", "project_urls": null, "release_url": "https://pypi.org/project/confi/0.0.4.1/", "requires_dist": null, "requires_python": "", "summary": "Comfortable python app configuration", "version": "0.0.4.1" }, "last_serial": 4324596, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ec039566dbe4ae83cf00edef5e7d40e1", "sha256": "906f7cce435eba2daaa7401e8b0370900e9768df37891a252f8334db46c8d882" }, "downloads": -1, "filename": "confi-0.0.1.tar.gz", "has_sig": false, "md5_digest": "ec039566dbe4ae83cf00edef5e7d40e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2961, "upload_time": "2018-08-10T13:30:27", "url": "https://files.pythonhosted.org/packages/07/8e/21723a33808a344433781b88ca7a36efa01bec20c3c7b0837913bfe18c5e/confi-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "2a1ff9f2ac64083dc3000b789f72005a", "sha256": "e734ccbb7c4138f9537abc9437d901dfcff9a0c2fc898d29b2f45d585de3489a" }, "downloads": -1, "filename": "confi-0.0.2-py3.6.egg", "has_sig": false, "md5_digest": "2a1ff9f2ac64083dc3000b789f72005a", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 6449, "upload_time": "2018-08-14T10:44:30", "url": "https://files.pythonhosted.org/packages/e5/cc/279e824e30928efb446b04883d6fd6f6a45086407651e43de39e2a4dc7e9/confi-0.0.2-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "5a8e14853b044009e73faa93e9cc6eba", "sha256": "b7583820e858cf6cef936fb8ed5bff34883ac012da1d7c57a296447047b84e72" }, "downloads": -1, "filename": "confi-0.0.2.tar.gz", "has_sig": false, "md5_digest": "5a8e14853b044009e73faa93e9cc6eba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3002, "upload_time": "2018-08-14T10:40:16", "url": "https://files.pythonhosted.org/packages/8c/43/71517d3a2191e81318375d04f50de78ab037d436e1eae1dbc4cd289c4ff1/confi-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "ded29f7124c2617c01229bd20d755379", "sha256": "f0bc41ac4efad032b79511e53b67087e6b8cf86431b65e7601d39bfd8f7a1745" }, "downloads": -1, "filename": "confi-0.0.3.tar.gz", "has_sig": false, "md5_digest": "ded29f7124c2617c01229bd20d755379", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3094, "upload_time": "2018-08-14T13:14:30", "url": "https://files.pythonhosted.org/packages/22/6c/8a7399b946c553ec0956d454349b0541fcc7af0ece3e111849503f7ab4c3/confi-0.0.3.tar.gz" } ], "0.0.4.1": [ { "comment_text": "", "digests": { "md5": "d1b11f54eaeb3b9552b635b932b8e09a", "sha256": "0ffb8ebba51194f7be7b3b1bc0946216de42417e83fd487e83e8efb0450897c6" }, "downloads": -1, "filename": "confi-0.0.4.1.tar.gz", "has_sig": false, "md5_digest": "d1b11f54eaeb3b9552b635b932b8e09a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3185, "upload_time": "2018-09-30T09:09:26", "url": "https://files.pythonhosted.org/packages/33/6c/d550680225b086899109c41ecb0fa1a64351d7d18d6ec578cc6103c6549b/confi-0.0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d1b11f54eaeb3b9552b635b932b8e09a", "sha256": "0ffb8ebba51194f7be7b3b1bc0946216de42417e83fd487e83e8efb0450897c6" }, "downloads": -1, "filename": "confi-0.0.4.1.tar.gz", "has_sig": false, "md5_digest": "d1b11f54eaeb3b9552b635b932b8e09a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3185, "upload_time": "2018-09-30T09:09:26", "url": "https://files.pythonhosted.org/packages/33/6c/d550680225b086899109c41ecb0fa1a64351d7d18d6ec578cc6103c6549b/confi-0.0.4.1.tar.gz" } ] }