{ "info": { "author": "Sebastian Brunner", "author_email": "sebastian.brunner@dlr.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "yaml\\_configuration\n===================\n\nThis module offers easy configuration for a other modules or startup\nscripts. It offers an easy way to load and save config files and read\nand write config values to it. Also trying to read a config value by\npassing an optional default value if the real config value is not\npresent is supported.\n\nUsage\n=====\n\nThe class DefaultConfig provides the basic functionality of the package.\nA custom configuration class is meant to derive from it.\n\n.. code:: python\n\n import os\n import logging\n from pytest import raises\n from yaml_configuration.config import DefaultConfig, ConfigError\n\n\n def read_file(file_path, filename):\n file_path = os.path.join(file_path, filename)\n with open(file_path, 'r') as file_pointer:\n file_content = file_pointer.read()\n return file_content\n\n\n class BasicConfig(DefaultConfig):\n\n def __init__(self, config_string, config_file, logger_object=None):\n super(BasicConfig, self).__init__(config_string, logger_object)\n # this is already done in the init\n # self.load(config_file, path=os.path.dirname(__file__))\n\n\n if __name__ == '__main__':\n config_file = \"basic_config.yaml\"\n config_string = read_file(os.path.dirname(__file__), config_file)\n basic_config = BasicConfig(config_string, config_file, logging.getLogger(\"TestLogger\"))\n basic_config.set_config_value(\"number_value\", 10)\n basic_config.set_config_value(\"string_value\", \"test_string\")\n assert basic_config.get_config_value(\"string_value\") == \"test_string\"\n assert basic_config.get_config_value(\"not_existing_config_value\", default=42) == 42\n with raises(ConfigError):\n if not basic_config.get_config_value(\"value_that_should_exist\"):\n raise ConfigError(\"The config value with key 'value_that_should_exist' should exist\")\n\n..\n\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/DLR-RM/python-yaml-configuration", "keywords": "yaml,configuration", "license": "BSD", "maintainer": "Sebastian Brunner", "maintainer_email": "sebastian.brunner@dlr.de", "name": "yaml-configuration", "package_url": "https://pypi.org/project/yaml-configuration/", "platform": "", "project_url": "https://pypi.org/project/yaml-configuration/", "project_urls": { "Homepage": "https://github.com/DLR-RM/python-yaml-configuration" }, "release_url": "https://pypi.org/project/yaml-configuration/0.2.0/", "requires_dist": [ "pyyaml (>=5.1)" ], "requires_python": ">=2.6", "summary": "A python module to easily read from and write to yaml config files.", "version": "0.2.0" }, "last_serial": 5237764, "releases": { "0.0.9": [ { "comment_text": "", "digests": { "md5": "46c5a1ea53f8c1bbed1d159f8e207111", "sha256": "4b71a2fabfb9a755aafcd922b906826ca7ce09796a5d634849941cc3862f1adb" }, "downloads": -1, "filename": "yaml_configuration-0.0.9.tar.gz", "has_sig": true, "md5_digest": "46c5a1ea53f8c1bbed1d159f8e207111", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4460, "upload_time": "2017-04-13T09:47:00", "url": "https://files.pythonhosted.org/packages/5b/8a/3926e2a56e5550f434a30ea1e2a194582340e1bd90077d36510d75de0b50/yaml_configuration-0.0.9.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "91780552b4accb12e48c4f4d695bb76d", "sha256": "8278617c16ce03772b277e989b076f0ef3bf03524a694ec935c17224fb863827" }, "downloads": -1, "filename": "yaml_configuration-0.1.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "91780552b4accb12e48c4f4d695bb76d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 5576, "upload_time": "2018-11-25T13:04:03", "url": "https://files.pythonhosted.org/packages/7f/38/f891e60d4d6ac280a65eeadad3acc4d3ae652cdb7fe590761aad8904b4f9/yaml_configuration-0.1.0.linux-x86_64.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "384c2f9884301946317924d73d2f8a46", "sha256": "16159633377e9b3e1f7a2eb6bd00be5ef34b8aef6678b1e00a312fce1b2bff62" }, "downloads": -1, "filename": "yaml_configuration-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "384c2f9884301946317924d73d2f8a46", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.6", "size": 5432, "upload_time": "2018-11-25T13:09:43", "url": "https://files.pythonhosted.org/packages/f7/a6/10e5939ba65735bfff2eac370e17b65d1df2d4036f358cdeda36b61549c1/yaml_configuration-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "823f334fba92879fb8fc0ca0b3b7c258", "sha256": "31c2c746ba6d9fed98515cbc1063081c44eb2c6c20e18c5ee25de6f0c04b9599" }, "downloads": -1, "filename": "yaml_configuration-0.1.1.tar.gz", "has_sig": false, "md5_digest": "823f334fba92879fb8fc0ca0b3b7c258", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 7100, "upload_time": "2018-11-25T13:09:45", "url": "https://files.pythonhosted.org/packages/52/78/2421bcf39b91c5c04ad8ef005a2fe5b82a94f401a7bd26c57cd9af74a149/yaml_configuration-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a189de9fb027b26e6e16f21e07707685", "sha256": "6b64882cd95d73c7807e3d37f219b150d1975b951f7c27dcb15da559dd2d7b6e" }, "downloads": -1, "filename": "yaml_configuration-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a189de9fb027b26e6e16f21e07707685", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 4872, "upload_time": "2018-12-12T13:28:56", "url": "https://files.pythonhosted.org/packages/62/42/eccf1367faefdb56863db62be170c7903f7ff76e42ad81112f3cfeb0e508/yaml_configuration-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "28cd444a7c5c74a2aa1e7be735a77177", "sha256": "43328742910e77f4eed73014a6e14653c8d7460e76646a024def127fe7f3035b" }, "downloads": -1, "filename": "yaml_configuration-0.1.3.tar.gz", "has_sig": false, "md5_digest": "28cd444a7c5c74a2aa1e7be735a77177", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 4949, "upload_time": "2018-12-17T15:07:17", "url": "https://files.pythonhosted.org/packages/99/9a/26f5b15ccb1f62c60770982bd0cd59c4304d00a8cfda334fbe1cabf5357b/yaml_configuration-0.1.3.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "e7d0694d67fbf69269260b7d97b4f900", "sha256": "2122f954930097a45ffdc7052e6e852b5c00dd5ff096e36e46d91277abff1492" }, "downloads": -1, "filename": "yaml_configuration-0.1.7-py2-none-any.whl", "has_sig": false, "md5_digest": "e7d0694d67fbf69269260b7d97b4f900", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.6", "size": 5375, "upload_time": "2019-05-07T08:12:12", "url": "https://files.pythonhosted.org/packages/48/06/1c2fbd7a967b9bba4e44c50b11eb7743fdc956ea304f309914f370707321/yaml_configuration-0.1.7-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "757287848791f8daba6f81d3eefb1838", "sha256": "895b040bfd3f7f2c3dd3aa0d729c19132d4d8dd98cacb84fc560b2b1ab99030c" }, "downloads": -1, "filename": "yaml_configuration-0.1.7.tar.gz", "has_sig": false, "md5_digest": "757287848791f8daba6f81d3eefb1838", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 5119, "upload_time": "2019-05-07T08:12:14", "url": "https://files.pythonhosted.org/packages/12/41/1280f7ff6de8a779ec217b38ae53925bba9c2e4047772fdeb470689ee34a/yaml_configuration-0.1.7.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a8771fe5caad632b2ea12dd27f4ef472", "sha256": "dce8809842429ca13510b35d34a727a02351d73264e03a4ec84e65d2bbe3e263" }, "downloads": -1, "filename": "yaml_configuration-0.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "a8771fe5caad632b2ea12dd27f4ef472", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.6", "size": 5376, "upload_time": "2019-05-07T11:19:41", "url": "https://files.pythonhosted.org/packages/c4/24/5e74aa034b6dc038e938c3d474da3c444b8d2b4f285ed1c342beb404e993/yaml_configuration-0.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd8838114d484841d85c818c255168c6", "sha256": "2d8251c84c0de58fa8a023689c3efeaf8741b29008abc59ef2a5beb333d75f7c" }, "downloads": -1, "filename": "yaml_configuration-0.2.0.tar.gz", "has_sig": false, "md5_digest": "bd8838114d484841d85c818c255168c6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 5115, "upload_time": "2019-05-07T11:19:42", "url": "https://files.pythonhosted.org/packages/ec/0d/a1a99437f19f47ec5ddaaf1b2e5ec0d099af40efa7d8c12b8426bb8bd491/yaml_configuration-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a8771fe5caad632b2ea12dd27f4ef472", "sha256": "dce8809842429ca13510b35d34a727a02351d73264e03a4ec84e65d2bbe3e263" }, "downloads": -1, "filename": "yaml_configuration-0.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "a8771fe5caad632b2ea12dd27f4ef472", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.6", "size": 5376, "upload_time": "2019-05-07T11:19:41", "url": "https://files.pythonhosted.org/packages/c4/24/5e74aa034b6dc038e938c3d474da3c444b8d2b4f285ed1c342beb404e993/yaml_configuration-0.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd8838114d484841d85c818c255168c6", "sha256": "2d8251c84c0de58fa8a023689c3efeaf8741b29008abc59ef2a5beb333d75f7c" }, "downloads": -1, "filename": "yaml_configuration-0.2.0.tar.gz", "has_sig": false, "md5_digest": "bd8838114d484841d85c818c255168c6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 5115, "upload_time": "2019-05-07T11:19:42", "url": "https://files.pythonhosted.org/packages/ec/0d/a1a99437f19f47ec5ddaaf1b2e5ec0d099af40efa7d8c12b8426bb8bd491/yaml_configuration-0.2.0.tar.gz" } ] }