{ "info": { "author": "Chris Beaven", "author_email": "smileychris@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "========\nEasyConf\n========\n\nEasy file-based and environment configuration.\n\nUsage\n=====\n\nFirst create a ``Config`` object:\n\n.. code:: python\n\n config = easyconf.Config('config.yaml')\n\nThen reference a configuration variable as an attribute of this object:\n\n.. code:: python\n\n some_variable = config.SOME_VARIABLE()\n\nAt runtime, EasyConf will try to each variable from the following sources\nin order:\n\n1. A matching environment variable\n\n2. A matching variable within the configuration file\n\n3. The ``default`` attribute (if no attribute is provided, an\n ``easyconf.config.RequiredConfigVarMissing`` exception will be raised)\n\nConfig file generation\n----------------------\n\nIf the ``Config`` file doesn't exist yet and the file location is writable,\nEasyConf will generate it using the ``initial`` values and commented\n``default`` values defined in each configuration variable.\n\nIf the configuration file is within a git repository it will also be added to\nthe ``.gitignore`` file.\n\nDon't hide configuration variables within conditional statements, load them at\nthe top of a module so they can be generated regardless.\n\nIf you don't want file generation for non-existant configuration, use\n``generate=False`` when instantiating the ``Config`` object.\n\n\nExample Django configuration\n============================\n\n.. code:: python\n\n import easyconf\n\n config = easyconf.Config('myproject.yaml')\n\n DEBUG = config.DEBUG(default=False)\n DATABASES = {'default': config.DATABASE(\n default='postgres:///myproject',\n cast=easyconf.dict_or_url,\n )}\n SECRET_KEY = config.SECRET_KEY(initial=easyconf.random_text_generator(60))\n\n\nConfiguration Variable options\n==============================\n\n``default``\n The default value for the variable if it is not provided in the environment\n or in the configuration file.\n\n``initial``\n A value or callable used to set the initial value of a variable in the\n configuration file.\n\n``help``\n Help text to use in the configuration file for this variable.\n\n``cast``\n A callable to convert an incoming value (from the environment or default\n value) to the correct Python type.\n\n Set the ``cast_from_config`` attribute of this callable to ``True`` if it\n is safe to cast from the configuration file as well.\n\n\n``Config`` Object options\n=========================\n\n``default_files``\n A file or list of files to attempt to read configuration variables from. If\n multiple files are provided, only the first one found will be used.\n\n If none of the provided files are found, the first one in a writable\n location will be created and populated automatically.\n\n``file_env_var``\n An environment variable which could be used to specify the configuration\n file path.\n\n If provided and an environment variable matches, this overrides any\n ``default_files`` specified.\n\n``generate``\n Whether to generate a new config file if none of the default_files can be\n loaded. Defaults to ``True``.\n\n\nHelper Modules\n==============\n\n``easyconf.dict_or_url``\n------------------------\n\nExpand url strings defined in django-environ_ into dictionaries. For example:\n\n.. code:: pycon\n\n >>> import easyconf\n >>> easyconf.dict_or_url('mysql:///abc')\n {'NAME': 'abc', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', 'ENGINE': 'django.db.backends.mysql'}\n\n.. _django-environ: https://pypi.org/project/django-environ/\n\nThis will also cast url strings coming from the configuration file.\n\n\n``easyconf.random_text_generator``\n----------------------------------\n\nCreates a function that can be called to securely generate a random text string\nof a predefined length (containing base64 characters).\n\nUseful for the ``initial`` configuration variable option.\n\n.. code:: pycon\n\n >>> import easyconf\n >>> gen = easyconf.random_text_generator(20)\n >>> gen()\n 'sYw0D/7xjXqxfCyUdHqr'\n >>> gen()\n 'ig1Z1n+mFLt+qYNOmD6I'\n\n==========\nChange Log\n==========\n\n1.3.1 (2019-08-26)\n==================\n\n- Don't require git executable to be installed.\n\n\n1.3 (2019-08-02)\n================\n\n- Use environment values for automatic configuration generation.\n\n\n1.2.2 (2019-08-02)\n==================\n\n- Correctly lock down ``ruamel.yaml`` this time (it's v0.16, not v16).\n\n\n1.2.1 (2019-08-01)\n==================\n\n- Avoid new version of ``ruamel.yaml`` which changed loading format.\n\n\n1.2 (2019-05-21)\n================\n\n- When generating a config that is within a git repository, add it to\n ``.gitignore``.\n\n- If a cast callable has a ``cast_from_config`` attribute set to ``True``, cast\n values coming from the configuration file. This is set to ``True`` for the\n ``dict_or_url`` helper method.\n\n\n1.1.1 (2019-05-16)\n==================\n\n- Fix issue with generating multiple comments (for multiple default values) at\n the end of the YAML config.\n\n- Cast default values when writing to config.\n\n\n1.1 (2019-05-15)\n================\n\n- Allow explicit disabling of automatic config generation.\n\n- Cast default values if a ``cast`` argument is provided.\n\n\n1.0 (2019-05-15)\n================\n\n- Initial Release\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/lincolnloop/easyconf/", "keywords": "configuration", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "easyconf", "package_url": "https://pypi.org/project/easyconf/", "platform": "", "project_url": "https://pypi.org/project/easyconf/", "project_urls": { "Homepage": "https://github.com/lincolnloop/easyconf/" }, "release_url": "https://pypi.org/project/easyconf/1.3.1/", "requires_dist": [ "django-environ", "ruamel.yaml (<0.16)", "gitpython", "pytest ; extra == 'dev'", "pytest-cov ; extra == 'dev'", "pytest-mock ; extra == 'dev'", "zest.releaser[recommended] ; extra == 'maintainer'" ], "requires_python": "", "summary": "Easy file-based and environment configuration.", "version": "1.3.1" }, "last_serial": 5728158, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "f9604804ff0d44c02e0996f15618dd58", "sha256": "f116aa2ed29f9367840e61191d37c5891ab5806e9822654b7cf2ab003cc5230a" }, "downloads": -1, "filename": "easyconf-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f9604804ff0d44c02e0996f15618dd58", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7056, "upload_time": "2019-05-15T03:42:08", "url": "https://files.pythonhosted.org/packages/f2/b0/394fa4c7a4a0622c00cef612d614d765d42d949c952a8a33ff9f9f220ab3/easyconf-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e7fae987f5df947a08f99636b1c4a607", "sha256": "1a9d4b2aab98888d00590e4d50a360e205254247956a2578d2213f585933e0b9" }, "downloads": -1, "filename": "easyconf-1.0.tar.gz", "has_sig": false, "md5_digest": "e7fae987f5df947a08f99636b1c4a607", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7641, "upload_time": "2019-05-15T03:42:10", "url": "https://files.pythonhosted.org/packages/f0/61/12bb0dbdb02d052301f0c38538138ed5a0e96cc3ac0a0d306bc3b80ccc82/easyconf-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "46cf62007d110335d3801c111040a1cf", "sha256": "1d1ad72263f2df6e96e7e8627784cfc96d130cfe9fa3f1d2edf7ae2aa15b08a3" }, "downloads": -1, "filename": "easyconf-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "46cf62007d110335d3801c111040a1cf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7237, "upload_time": "2019-05-15T05:02:08", "url": "https://files.pythonhosted.org/packages/6d/75/ae60d1c6540135aeab6ac155e4b2d0cf34b962fb6d289035796db8302e24/easyconf-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e76375e9859840c2565a0bef3df2abf", "sha256": "deb8d50c4c3bc022ff99d4c0cdc9a487a03c50f96d941b421d4312cbd6bec4b8" }, "downloads": -1, "filename": "easyconf-1.1.tar.gz", "has_sig": false, "md5_digest": "8e76375e9859840c2565a0bef3df2abf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7898, "upload_time": "2019-05-15T05:02:10", "url": "https://files.pythonhosted.org/packages/e0/48/8b6775ea03e4daab87e2f7e9e803b37d02c43762d19049a4cb7045465372/easyconf-1.1.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "ec063ebb371062f9fcc884d04ba8284b", "sha256": "6dd2054e7dfdf408df10a392f443075db6a07f14ff1a301e1f15382adc2ceeaf" }, "downloads": -1, "filename": "easyconf-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ec063ebb371062f9fcc884d04ba8284b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7331, "upload_time": "2019-05-16T03:01:53", "url": "https://files.pythonhosted.org/packages/7a/f9/de204b0f501c935dc2b278f31bed958f5194fd17e28375adec2c230a626a/easyconf-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7da939320a6f60e79de2224827ec1c6b", "sha256": "9e3d2fa0011855259d7e4af1fb75c6459275595aeb39458d7f1a34391b5911f3" }, "downloads": -1, "filename": "easyconf-1.1.1.tar.gz", "has_sig": false, "md5_digest": "7da939320a6f60e79de2224827ec1c6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8067, "upload_time": "2019-05-16T03:01:55", "url": "https://files.pythonhosted.org/packages/54/2f/7526dee758263db75449380aff062eaf6b86c270a061ba78b1cd45f35c6a/easyconf-1.1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "88d325d3c6bbbd1eb454e12c7c69c24d", "sha256": "2b5468191e50a6064fbbbc07bbd4b40e02317fed75118bf80d2d63239647afa2" }, "downloads": -1, "filename": "easyconf-1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "88d325d3c6bbbd1eb454e12c7c69c24d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8302, "upload_time": "2019-05-20T22:33:43", "url": "https://files.pythonhosted.org/packages/d8/68/8dda6e82697ba0c572f1fd233711f76ef693e8a171d6ab82d920116a422e/easyconf-1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dfeeb2ae447fbb392235cb3acd248bda", "sha256": "b7ce509053b3c2b3c58d1579df6fbbf729fd8aefd691b26cf4f407f116256af8" }, "downloads": -1, "filename": "easyconf-1.2.tar.gz", "has_sig": false, "md5_digest": "dfeeb2ae447fbb392235cb3acd248bda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9220, "upload_time": "2019-05-20T22:33:45", "url": "https://files.pythonhosted.org/packages/7e/6a/5cc471ace80a23680870b173c21d6b99dd75fc8f4c9515ba2a3df14344e5/easyconf-1.2.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "66b450228dd34a9765b7154207802f6d", "sha256": "8207afa34d7b829567c7dbcecca14397462fc9f001d54aa51cdf2c79f0a6086f" }, "downloads": -1, "filename": "easyconf-1.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "66b450228dd34a9765b7154207802f6d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8371, "upload_time": "2019-08-01T11:10:16", "url": "https://files.pythonhosted.org/packages/4e/2f/22599ce1192576083993f34593b3b87a217a0ea743cd36a07ec6e11cf196/easyconf-1.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3bbb9779d3b626c431049db4a261c306", "sha256": "4d9749ad1438660a00757db6cb8dee823edb2ed5c7263fa71ca3ff0556183716" }, "downloads": -1, "filename": "easyconf-1.2.1.tar.gz", "has_sig": false, "md5_digest": "3bbb9779d3b626c431049db4a261c306", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9404, "upload_time": "2019-08-01T11:10:18", "url": "https://files.pythonhosted.org/packages/bd/a9/76a21db71c9db0644393eb87af57d6055dc53069f4b134ed49b0651f0ce4/easyconf-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "06896f2871408ddf03e23cc217a0184f", "sha256": "8c7042f7f01b27719d7db88f67fad9650d5b154995cd368d53c7774edc56ef82" }, "downloads": -1, "filename": "easyconf-1.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "06896f2871408ddf03e23cc217a0184f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8416, "upload_time": "2019-08-01T23:00:29", "url": "https://files.pythonhosted.org/packages/04/62/570d6cec4c0ed4f39721f23568661829e50b9680ff239f071bf8ea634831/easyconf-1.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d38641931389b167d425b7a2f4eec716", "sha256": "87d72e9d3f34b52e21f884ed161b414d341bf18ca9b487bc84562a6b007cad11" }, "downloads": -1, "filename": "easyconf-1.2.2.tar.gz", "has_sig": false, "md5_digest": "d38641931389b167d425b7a2f4eec716", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9456, "upload_time": "2019-08-01T23:00:30", "url": "https://files.pythonhosted.org/packages/fb/5c/586aba04e309d5f1028c8fe3f4c965ce29e0af2ec9f986a38a86416fabfc/easyconf-1.2.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "ce927f95ba8be9b884e710c3f9f55bf2", "sha256": "2f282685cc639eb1309fd0f463d776a6dae52d1f3ddbf3128cd1ba0cf737e0e2" }, "downloads": -1, "filename": "easyconf-1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ce927f95ba8be9b884e710c3f9f55bf2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8520, "upload_time": "2019-08-02T09:22:43", "url": "https://files.pythonhosted.org/packages/1b/56/dadde7abe14d896e9cb0b481152df90da00dcc3818f6f9995e963058f3ee/easyconf-1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e9ed9bd26db982eec904466c198e0270", "sha256": "824f9fd3157c2c3834b52f428c2854a2139268b38ebb429716be65e7a61e1552" }, "downloads": -1, "filename": "easyconf-1.3.tar.gz", "has_sig": false, "md5_digest": "e9ed9bd26db982eec904466c198e0270", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9710, "upload_time": "2019-08-02T09:22:45", "url": "https://files.pythonhosted.org/packages/44/87/e9f312bb5633feaccf7f764a667113ea4c9eb7ac667ad574c08eb0085cc7/easyconf-1.3.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "09da7522f54bdd2862b7e05bf65c9fe2", "sha256": "9c72ae0702625a60792120e030b28ae3542b88dc7c7b9dd6eae3a2a845d1edaa" }, "downloads": -1, "filename": "easyconf-1.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "09da7522f54bdd2862b7e05bf65c9fe2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8605, "upload_time": "2019-08-25T22:31:26", "url": "https://files.pythonhosted.org/packages/aa/84/b229d0084684882e7a335c6cb054ec5a5e50111a26dac6c743d75fb8dbdc/easyconf-1.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fa46569099433b6cf474fac8852a7828", "sha256": "d7127c93e5e1720b308a8f238876b49ffd40bc4b9ccfc215c03c3c93ac2aa10e" }, "downloads": -1, "filename": "easyconf-1.3.1.tar.gz", "has_sig": false, "md5_digest": "fa46569099433b6cf474fac8852a7828", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9834, "upload_time": "2019-08-25T22:31:28", "url": "https://files.pythonhosted.org/packages/34/5d/10cbbcb491740228ca4bf621f2816547c1b6ecd6f440ab6ed4e5e4d098f8/easyconf-1.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "09da7522f54bdd2862b7e05bf65c9fe2", "sha256": "9c72ae0702625a60792120e030b28ae3542b88dc7c7b9dd6eae3a2a845d1edaa" }, "downloads": -1, "filename": "easyconf-1.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "09da7522f54bdd2862b7e05bf65c9fe2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8605, "upload_time": "2019-08-25T22:31:26", "url": "https://files.pythonhosted.org/packages/aa/84/b229d0084684882e7a335c6cb054ec5a5e50111a26dac6c743d75fb8dbdc/easyconf-1.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fa46569099433b6cf474fac8852a7828", "sha256": "d7127c93e5e1720b308a8f238876b49ffd40bc4b9ccfc215c03c3c93ac2aa10e" }, "downloads": -1, "filename": "easyconf-1.3.1.tar.gz", "has_sig": false, "md5_digest": "fa46569099433b6cf474fac8852a7828", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9834, "upload_time": "2019-08-25T22:31:28", "url": "https://files.pythonhosted.org/packages/34/5d/10cbbcb491740228ca4bf621f2816547c1b6ecd6f440ab6ed4e5e4d098f8/easyconf-1.3.1.tar.gz" } ] }