{ "info": { "author": "Tomislav Adamic", "author_email": "tomislav.adamic@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Overview\n\n\n\nEver wanted to load plain `.ini` config files and then validate loaded config?\n\nEver wanted to load config from multiple locations (`/etc/appconfig.conf`, `~/.appconfig.conf`) into single object and then validate that?\n\nWorry no more!\n\nPython's [ConfigParser] met [marshmallow] and now they get along just fine - without any JSON in sight to spoil the fun.\n\n## Installation\n\n~~~sh\npip install marshmallow_configparser\n~~~\n\n## Example\n\nHaving config file `/tmp/example_config.conf` looking like this:\n\n~~~ini\n[Section1]\noption1 = mandatory string\noption2 = optional string\noption3 = 42\noption4 = 24\n\n[Section2]\noption1 = mandatory string\noption2 = optional string\noption3 = 42\noption4 = 24\n~~~\n\nAnd wanting to load it into our config object:\n\n~~~python\nclass ConfigObject(object):\n MANDATORY_STRING1 = None\n OPTIONAL_STRING1 = None\n MANDATORY_INTEGER1 = None\n OPTIONAL_INTEGER1 = None\n MANDATORY_STRING2 = None\n OPTIONAL_STRING2 = None\n MANDATORY_INTEGER2 = None\n OPTIONAL_INTEGER2 = None\n~~~\n\nWe can define [marshmallow] schema:\n\n~~~python\nfrom marshmallow.validate import Range\n\nfrom marshmallow_configparser import (ConfigBoolean, ConfigInteger,\n ConfigParserSchema, ConfigString,\n IsNotBlank)\n\nclass ConfigSchema(ConfigParserSchema):\n class Meta:\n model = ConfigObject\n\n MANDATORY_STRING1 = ConfigString(\n section='Section1', load_from='option1', dump_to='option1',\n validate=[IsNotBlank()]\n )\n OPTIONAL_STRING1 = ConfigString(\n section='Section1', load_from='option2', dump_to='option2',\n )\n MANDATORY_INTEGER1 = ConfigInteger(\n section='Section1', load_from='option3', dump_to='option3',\n validate=[Range(min=24, max=42)]\n )\n OPTIONAL_INTEGER1 = ConfigInteger(\n section='Section1', load_from='option4', dump_to='option4',\n )\n\n MANDATORY_STRING2 = ConfigString(\n section='Section2', load_from='option1', dump_to='option1',\n validate=[IsNotBlank()]\n )\n OPTIONAL_STRING2 = ConfigString(\n section='Section2', load_from='option2', dump_to='option2',\n )\n MANDATORY_INTEGER2 = ConfigInteger(\n section='Section2', load_from='option3', dump_to='option3',\n validate=[Range(min=24, max=42)]\n )\n OPTIONAL_INTEGER2 = ConfigInteger(\n section='Section2', load_from='option4', dump_to='option4',\n )\n~~~\n\nWhich can then load and validate our config:\n\n~~~python\nschema = ConfigSchema()\nobj, errors = schema.load(['/tmp/example_config.conf'])\n~~~\n\nIn the end we have:\n\n~~~python\nobj.__dict_\n\n{'MANDATORY_INTEGER1': 42,\n 'MANDATORY_INTEGER2': 42,\n 'MANDATORY_STRING1': 'mandatory string',\n 'MANDATORY_STRING2': 'mandatory string',\n 'OPTIONAL_INTEGER1': 24,\n 'OPTIONAL_INTEGER2': 24,\n 'OPTIONAL_STRING1': 'optional string',\n 'OPTIONAL_STRING2': 'optional string'}\n~~~\n\nInstead of using convenience classes like `ConfigString`, there are also classes in `marshmallow_configparser.fields` module that expose full [marshmallow] API. Check the docs for details.\n\n## Documentation\n\nhttp://marshmallow-configparser.readthedocs.io/en/latest/index.html\n\n[marshmallow]: https://github.com/marshmallow-code/marshmallow\n[ConfigParser]: https://docs.python.org/3/library/configparser.html#configparser.ConfigParser\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/tadams42/marshmallow_configparser", "keywords": "congfiparser,marshmallow", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "marshmallow-configparser", "package_url": "https://pypi.org/project/marshmallow-configparser/", "platform": "", "project_url": "https://pypi.org/project/marshmallow-configparser/", "project_urls": { "Homepage": "https://github.com/tadams42/marshmallow_configparser" }, "release_url": "https://pypi.org/project/marshmallow-configparser/0.4.0/", "requires_dist": [ "check-manifest; extra == 'dev'", "factory-boy; extra == 'dev'", "faker; extra == 'dev'", "ipython; extra == 'dev'", "isort; extra == 'dev'", "m2r; extra == 'dev'", "pycodestyle; extra == 'dev'", "pylint; extra == 'dev'", "pytest-cov; extra == 'dev'", "pytest-mock; extra == 'dev'", "pytest-sugar; extra == 'dev'", "pytest (>=3.0.0); extra == 'dev'", "sphinx; extra == 'dev'", "sphinx-rtd-theme; extra == 'dev'", "yapf; extra == 'dev'", "m2r (>=0.1.14); extra == 'docs'", "sphinx (>=1.4); extra == 'docs'", "sphinx-rtd-theme; extra == 'docs'", "marshmallow", "bumpversion; extra == 'dev'", "coverage; extra == 'dev'" ], "requires_python": "", "summary": "ConfigParser meets marshmallow", "version": "0.4.0" }, "last_serial": 4312209, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6f42a2dc9e664d4829ca584fd3ba2cef", "sha256": "eb7875cfad6133cf2512d1a2c9f4502e5e41c6fbcb603af53d403ec66d2d254a" }, "downloads": -1, "filename": "marshmallow_configparser-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6f42a2dc9e664d4829ca584fd3ba2cef", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7534, "upload_time": "2017-05-01T15:47:49", "url": "https://files.pythonhosted.org/packages/3d/4a/d65dc492d1ea2676cdecd505c31b89fb8af60708607e6dd4aca400a42c8b/marshmallow_configparser-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cbe86acf0e8a44493089cbe3955cd0f7", "sha256": "a0d8ab2bee235d63d530b2e8953e3176b13dd1c570b28bbbff412f8f71b408ad" }, "downloads": -1, "filename": "marshmallow_configparser-0.1.0.tar.gz", "has_sig": false, "md5_digest": "cbe86acf0e8a44493089cbe3955cd0f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18021, "upload_time": "2017-05-01T15:47:52", "url": "https://files.pythonhosted.org/packages/25/a9/7585f537db891448942aeca41c4e74f1c034c8b10e0b610adf7224ee2661/marshmallow_configparser-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "4e248114284cca3d46648278562d52c8", "sha256": "f999e53daa80422b0c98efb33dd9438a9e2e005df35b43a26dc7c74c5b69f0d8" }, "downloads": -1, "filename": "marshmallow_configparser-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4e248114284cca3d46648278562d52c8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8828, "upload_time": "2017-05-02T13:32:59", "url": "https://files.pythonhosted.org/packages/06/cf/e2b7fd41bb3d4b18610388a3130500bc843d0422e058ecb8ea400259f884/marshmallow_configparser-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5a619d59b1aefdcf8ce81a5ebdcf2ac1", "sha256": "a875d5dded9a360b11e4f21a06d95ce52a2444870c70cbce0ecd292fbf32d57b" }, "downloads": -1, "filename": "marshmallow_configparser-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5a619d59b1aefdcf8ce81a5ebdcf2ac1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20449, "upload_time": "2017-05-02T13:33:01", "url": "https://files.pythonhosted.org/packages/4d/6d/fb1c105f2dffbf7d7765702ec8c4d33768b1a501848d6f01c894af76a21d/marshmallow_configparser-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "0f1b627f4f654d18bee17eb3c992860f", "sha256": "442fbc6e9aeba8a31c51985926b6de54a597d3fdb00f7245592a4a579b2213d4" }, "downloads": -1, "filename": "marshmallow_configparser-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0f1b627f4f654d18bee17eb3c992860f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9092, "upload_time": "2017-05-08T09:17:15", "url": "https://files.pythonhosted.org/packages/bb/8f/4e1f935dc433219dcec4f2d6060fea22872dddc00b0a3c025924abcffbc6/marshmallow_configparser-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0fb814f07591301ab3b2235edf9ba8b", "sha256": "4b4abddb822342e12e3530ab7280457bc4545ef253678787bca67cc3ee505f72" }, "downloads": -1, "filename": "marshmallow_configparser-0.3.0.tar.gz", "has_sig": false, "md5_digest": "a0fb814f07591301ab3b2235edf9ba8b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20635, "upload_time": "2017-05-08T09:17:17", "url": "https://files.pythonhosted.org/packages/67/d9/7de18cd5cd363343d259265d3ddff450bc53e92ef9ff111d6e6202bc57ec/marshmallow_configparser-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "f8e69e06cb30eb3ecac61e9fe529de69", "sha256": "daec45896e19251f32cbf6f511f411010a1be95f0ca2e6cb33374690b2bc2a62" }, "downloads": -1, "filename": "marshmallow_configparser-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f8e69e06cb30eb3ecac61e9fe529de69", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9047, "upload_time": "2017-08-07T10:40:02", "url": "https://files.pythonhosted.org/packages/85/12/27e294a9e99d7eb36301314c6afa33ffdb9388dc0285ffe402dcb428a282/marshmallow_configparser-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b37d7c8348ec56dede7955b12e713f9d", "sha256": "30c604e1e8bdf44c634d8779249c908d8b51f2e4290b5ef86b657538e451f214" }, "downloads": -1, "filename": "marshmallow_configparser-0.3.1.tar.gz", "has_sig": false, "md5_digest": "b37d7c8348ec56dede7955b12e713f9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22167, "upload_time": "2017-08-07T10:40:04", "url": "https://files.pythonhosted.org/packages/8f/a2/55b7160421a302bf2a2d28497125f88d070f35f9f544b4786fba3a6f6bf9/marshmallow_configparser-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "8aa7dd8459e4edcafb4c2136ba5b516d", "sha256": "eea85f3b6e1eac3471165fcbf432111cd4ea10e495a1bbda5d2dfb001fde7404" }, "downloads": -1, "filename": "marshmallow_configparser-0.3.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8aa7dd8459e4edcafb4c2136ba5b516d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9060, "upload_time": "2017-08-07T10:46:37", "url": "https://files.pythonhosted.org/packages/9e/8b/109686e3ac0fcb7a5be0ce9b560a4347dce88dd8d0ce9c477d5a4950f076/marshmallow_configparser-0.3.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a2734cd85c657e6208a0ce960fdf132b", "sha256": "56fc1a0a2ada312413bcba6e88cf5a8d83114ef1d8d6521a05b6b7307ccc492d" }, "downloads": -1, "filename": "marshmallow_configparser-0.3.2.tar.gz", "has_sig": false, "md5_digest": "a2734cd85c657e6208a0ce960fdf132b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22183, "upload_time": "2017-08-07T10:46:39", "url": "https://files.pythonhosted.org/packages/6d/50/2771a3cc1bbb6f29b673e6ea8a67455c7c6434cbbc46768dfbf6cc2e6837/marshmallow_configparser-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "30176adde285cadef22d5873b579b505", "sha256": "cbe8bb719a2aad05bff62cf0e758bbb8fdc8507b7a513f8713677e99b4aeaa6d" }, "downloads": -1, "filename": "marshmallow_configparser-0.3.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "30176adde285cadef22d5873b579b505", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9171, "upload_time": "2017-09-20T09:50:00", "url": "https://files.pythonhosted.org/packages/cb/9f/db5d332b6ab4c58ada99f5a879c6edc47c1f2fd97c813209b7aa4e65105b/marshmallow_configparser-0.3.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "53d35fc7a1b82808d25851120e726648", "sha256": "10737ac81db80c471e8aff267e983277f28246f17d1536254e5252c16be1fed9" }, "downloads": -1, "filename": "marshmallow_configparser-0.3.3.tar.gz", "has_sig": false, "md5_digest": "53d35fc7a1b82808d25851120e726648", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24066, "upload_time": "2017-09-20T09:49:46", "url": "https://files.pythonhosted.org/packages/4d/6f/f4d37d1e755175c7d37da5c6c15d5d03655ab4ec7aafe840d965f398c4f5/marshmallow_configparser-0.3.3.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "e7b94154f9fbba09ba517e8a9d89f1ae", "sha256": "09ed3a99a7a38d3ee8be8cdafeab493cc89a0380f8426554a04fcfa9c9ef464d" }, "downloads": -1, "filename": "marshmallow_configparser-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e7b94154f9fbba09ba517e8a9d89f1ae", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7311, "upload_time": "2018-09-26T12:21:24", "url": "https://files.pythonhosted.org/packages/ea/3a/ebe3f46bdde8f35c3ff593d78e93b7f73362b948111c55b73c42e95ae7ed/marshmallow_configparser-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b65f770987e6e75ee39a4a03303aa7b5", "sha256": "e5eec3f6c581ef3cd3fecdbdc86cb834c4c8d71d79475409644d15f69094d050" }, "downloads": -1, "filename": "marshmallow_configparser-0.4.0.tar.gz", "has_sig": false, "md5_digest": "b65f770987e6e75ee39a4a03303aa7b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24135, "upload_time": "2018-09-26T12:21:25", "url": "https://files.pythonhosted.org/packages/c6/91/e392b112d4b93289b6a4e89190d3f57f93f0259be2343b8b05dea87896c3/marshmallow_configparser-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e7b94154f9fbba09ba517e8a9d89f1ae", "sha256": "09ed3a99a7a38d3ee8be8cdafeab493cc89a0380f8426554a04fcfa9c9ef464d" }, "downloads": -1, "filename": "marshmallow_configparser-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e7b94154f9fbba09ba517e8a9d89f1ae", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7311, "upload_time": "2018-09-26T12:21:24", "url": "https://files.pythonhosted.org/packages/ea/3a/ebe3f46bdde8f35c3ff593d78e93b7f73362b948111c55b73c42e95ae7ed/marshmallow_configparser-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b65f770987e6e75ee39a4a03303aa7b5", "sha256": "e5eec3f6c581ef3cd3fecdbdc86cb834c4c8d71d79475409644d15f69094d050" }, "downloads": -1, "filename": "marshmallow_configparser-0.4.0.tar.gz", "has_sig": false, "md5_digest": "b65f770987e6e75ee39a4a03303aa7b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24135, "upload_time": "2018-09-26T12:21:25", "url": "https://files.pythonhosted.org/packages/c6/91/e392b112d4b93289b6a4e89190d3f57f93f0259be2343b8b05dea87896c3/marshmallow_configparser-0.4.0.tar.gz" } ] }