{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "**Lord of the Config** is a super-simple YAML-based configuration system. No\nmore meaningless key-checking or file creation. LOTConfig makes it easy to\ncreate, manage, and write configurations.\n\nRepository: https://bitbucket.org/bear_belly/lord_of_the_config\n\n## Examples\n\nHere are some quick-and-dirty examples for how the engine works::\n\n Python 3.6.3 (default, Oct 3 2017, 21:45:48)\n [GCC 7.2.0] on linux\n Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n >>> from lotconfig import Config\n >>> config = Config.load_or_create(\"sample.yaml\")\n >>> config['basic/thing']\n 'my_value'\n\n## Loading a config\n\nConfigs are loaded from YAML files. To load a config use the `Config.load`,\nmethod or--better yet--the `Config.load_or_create()` method for fool-proof\nconfig loading. This will create the file if it doesn't exist.\n\n## Accessing config values\n\nTo access configuration values, you can either use `config.get()` or\ndict-like access:\n\n # This will return \"default_value\" if nothing is set in '/path/to/param'\n config.get('path/to/param', 'default_value')\n # This will just return `None` if nothing is set in '/path/to/param'\n config['/path/to/param']\n\nYou can use typical dict functions, too, like `in`.\n\n## Setting Configuration Values\n\nWoah, there tiger! Unfortunately this isn't implemented yet. Since LOTConfig\nimplements advanced features (see below), setting a configruation value is\npretty intensive.\n\nHopefully it'll happen in the future.\n\nIn the meantime you'll be greeted with an Exception if you try to do this.\n\n## Writing a configuration\n\nTo write a configuration, call `config.write()` or `config.write_stream()`.\n\n## Advanced features\n\n### Modes\n\n**Modes** are special keywords in the yaml configuration.\n\nThere's a default keyword you can specify at the beginning of the file\nto specify a mode. For example::\n\n mode: development\n\nThis mode can be used throughout the file to specify different\nenvironments. For the mode value, prefix it with '@' (**and make sure\nto surround it with quotes, since YAML doesn't like '@' for keys**).\nFor example:\n\n server:\n '@development':\n host: localhost\n port: 5000\n '@production':\n host: example.com\n port: 5000\n\nThis way, whenever ``mode`` is ``'production'``, you can refer ``server``\nwill automatically refer to ``{host: \"example.com\", \"port\": 5000}``, and if\nmode is set to ``developemnt``, then ``server`` will refer to\n``{host: \"localhost\", \"port\": 5000}``.\n\n**IMPORTANT.** These mode keys are essentially invisible. You can't\nforce the configuation to read ``config['server/@development/host']``.\n\nSo if mode is ``production`` ``config['server/host']`` is ``example.com``.\nIf mode is ``development`` ``config['server/host']`` is ``localhost``.\n\n### References\n\nDon't repeat yourself. You can refer to another value within the config\nusing a key reference. Key references are strings that refer to other\nconfig values.\n\nReferences are preceded with a tilde (``~``).\n\nConsider the following example:\n\n database:\n home: ~server1\n remote: ~server2\n hardware:\n servers:\n server1: 192.168.0.1\n server2: 192.168.0.2\n\nThis would result in the following configuration:\n\n >> config['database/home']\n '192.168.0.1'\n >> config['database/remote']\n '192.16.0.2'\n\nSee? References help you to reduce the amount you have to type. You can even\nuse it for complex configurations:\n\n letter_a:\n category_a: ~cat_a\n category_b: ~cat_b\n letter_b:\n cat_a:\n item_a: 1\n item_b: false\n cat_b:\n item_a: 19\n item_b: 20\n\nThis would result in the following configuration:\n\n >> config['letter_a/category_a']\n {'item_a': 1, 'item_b': false}\n\n### evals\n\nEvals are probably the most powerful fo the bunch. They evaluate raw Python\ncode. **As such, use LOTConfig only on configuration files you trust**. In\nfuture versions a paramter may be passed to turn on evaluations.\n\nEvals begin with the keyword `eval>>`. The result is *always* a raw string.\nFor example:\n\n key: eval>> 1+2 # results in `config['key']` -> '3'\n\nTwo modules are available to be evaluated: `os` and `env`.\n\n key: eval>> os.environ['DISPLAY']\n # results in `config['key']` -> ':0'\n\nHome-page: UNKNOWN\nAuthor: Jordan Hewitt\nAuthor-email: jordan.h@startmail.com\nLicense: GPLv3\nDescription-Content-Type: UNKNOWN\nDescription: UNKNOWN\nPlatform: UNKNOWN\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "lotconfig", "package_url": "https://pypi.org/project/lotconfig/", "platform": "", "project_url": "https://pypi.org/project/lotconfig/", "project_urls": null, "release_url": "https://pypi.org/project/lotconfig/1.3/", "requires_dist": [ "dpath", "pyyaml" ], "requires_python": "", "summary": "# Lord of the Config", "version": "1.3" }, "last_serial": 3742781, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "873bb36eb9e5487cf34e4dc77138cca3", "sha256": "d06005ecd1ac3e2ee40cd538a09b1ebf5ef7e03be2740357abab773185d9b6c4" }, "downloads": -1, "filename": "lotconfig-1.0.linux-x86_64.tar.gz", "has_sig": true, "md5_digest": "873bb36eb9e5487cf34e4dc77138cca3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9054, "upload_time": "2018-03-09T22:10:50", "url": "https://files.pythonhosted.org/packages/6f/b5/e078a7631cc6ca27dd19e7d86d3aa00b277acddde7e57a6c8993a80c5bdf/lotconfig-1.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "942c3c5fe731afdc9340349597c48236", "sha256": "df43da336ce8945e45f29cf269caac2eb7a423c97ceb20e2e89e83b543c6c38c" }, "downloads": -1, "filename": "lotconfig-1.0-py3-none-any.whl", "has_sig": true, "md5_digest": "942c3c5fe731afdc9340349597c48236", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9005, "upload_time": "2018-03-09T22:10:49", "url": "https://files.pythonhosted.org/packages/12/35/729f59f33102236fe91beb814138c476393476bbc48987047d35c60c8194/lotconfig-1.0-py3-none-any.whl" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "2e3f882e5038036e6fe046e6a9c8823d", "sha256": "5b346c1440f1edb412cdf1ab89d98ffd00c59607ff48dcfc176c139facc7217a" }, "downloads": -1, "filename": "lotconfig-1.3.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "2e3f882e5038036e6fe046e6a9c8823d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7278, "upload_time": "2018-04-07T01:18:22", "url": "https://files.pythonhosted.org/packages/0d/6a/40acccc183168e276c29c452977c46662a756afa8846c9730420f0b3751b/lotconfig-1.3.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "223f9258047b5978c21f7d8ce00824df", "sha256": "643f6d4f2d811c734a296657d8299ee12d312ca80803d9250d5398fcd40785ed" }, "downloads": -1, "filename": "lotconfig-1.3-py3-none-any.whl", "has_sig": true, "md5_digest": "223f9258047b5978c21f7d8ce00824df", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8280, "upload_time": "2018-04-07T01:18:20", "url": "https://files.pythonhosted.org/packages/7b/5e/0ceaef626b3e9dcf497ad6cb5d9e779780f4ffeaeb4eceb397bad513444b/lotconfig-1.3-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2e3f882e5038036e6fe046e6a9c8823d", "sha256": "5b346c1440f1edb412cdf1ab89d98ffd00c59607ff48dcfc176c139facc7217a" }, "downloads": -1, "filename": "lotconfig-1.3.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "2e3f882e5038036e6fe046e6a9c8823d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7278, "upload_time": "2018-04-07T01:18:22", "url": "https://files.pythonhosted.org/packages/0d/6a/40acccc183168e276c29c452977c46662a756afa8846c9730420f0b3751b/lotconfig-1.3.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "223f9258047b5978c21f7d8ce00824df", "sha256": "643f6d4f2d811c734a296657d8299ee12d312ca80803d9250d5398fcd40785ed" }, "downloads": -1, "filename": "lotconfig-1.3-py3-none-any.whl", "has_sig": true, "md5_digest": "223f9258047b5978c21f7d8ce00824df", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8280, "upload_time": "2018-04-07T01:18:20", "url": "https://files.pythonhosted.org/packages/7b/5e/0ceaef626b3e9dcf497ad6cb5d9e779780f4ffeaeb4eceb397bad513444b/lotconfig-1.3-py3-none-any.whl" } ] }