{ "info": { "author": "Samun Victor", "author_email": "victor.samun@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3 :: Only" ], "description": "configchecker\n-------------\n|buildci| |coveralls| |pyversions|\n\n|DwnMonth| |DwnWeek| |DwnDay|\n\n|license|\n\nThis module helps to check ``configparser``-loaded configurations.\n\nUsage\n=====\n\n1. Initialize description of valid configuration:\n ``schema = configchecker.ConfigSchema()``\n2. Add an information of possible sections by calling ``schema.section`` with section name validator and boolean flag \u201esection required\u201c.\n3. In every section describe possible section's values by calling ``sect.value``.\n\nName/value validators\n=====================\n\nThere are basic validators:\n\n* ``ItemDefaultValidator`` \u2014 always returns true\n* ``ItemStringValidator`` \u2014 checks if a string equals to given (probably, case-insensitive)\n* ``ItemRegexValidator`` \u2014 checks matching a string to given regexp\n* ``ItemNumberValidator`` \u2014 checks that a string is a non-negative integer\n\nAnd validator-composers which allow to create more complex checks:\n\n* ``ItemNotValidator``, ``ItemAndValidator``, ``ItemOrValidator`` \u2014 first-order logic on validators\n* ``ItemCountValidator`` \u2014 takes a validator and a function that check number of validator's true positives (i.e. returns ``True``)\n\nExamples\n========\n\n.. code-block:: py\n\n import configparser\n import configchecker as v\n \n config = configparser.ConfigParser()\n config.read_file(\"config\")\n \n schema = v.ConfigSchema()\n \n # Section with name \u201eREQUIRED\u201c will be mandatory\n with schema.section(\"REQUIRED\") as s:\n # It must have keys matching regexp r'item_\\d+' and numeric value and nothing more\n s.value(v.ItemRegexValidator(r'item_\\d+', value_val=v.ItemNumberValidator()).no_other()\n \n # Section with name r'OPT_\\w+' (check by regexp) will be optional\n with schema.section(v.ItemRegexValidator(r'OPT_\\w+'), required=False) as s:\n # And it may have anything\n pass\n \n # Other sections will be restricted\n schema.no_other()\n \n # Run checks\n v.ConfigSchemaValidator(schema).validate(config)\n\n\nAlso, you can find lots of examples in tests (``test_configchecker.py``)\n\n\nAuthor\n======\n\nSamun Victor, victor.samun@gmail.com\n\n.. |buildci| image:: https://travis-ci.org/victorsamun/configvalidator.svg?branch=master\n :target: https://travis-ci.org/victorsamun/configvalidator\n.. |coveralls| image:: https://coveralls.io/repos/github/victorsamun/configvalidator/badge.svg?branch=master\n :target: https://coveralls.io/github/victorsamun/configvalidator?branch=master\n.. |license| image:: https://img.shields.io/pypi/l/configchecker.svg\n :target: https://github.com/victorsamun/configvalidator/blob/master/LICENSE\n.. |DwnMonth| image:: https://img.shields.io/pypi/dm/configchecker.svg\n.. |DwnWeek| image:: https://img.shields.io/pypi/dw/configchecker.svg\n.. |DwnDay| image:: https://img.shields.io/pypi/dd/configchecker.svg\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/configchecker.svg", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/victorsamun/configvalidator/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/victorsamun/configvalidator", "keywords": "configparser configchecker checking validate", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "configchecker", "package_url": "https://pypi.org/project/configchecker/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/configchecker/", "project_urls": { "Download": "https://github.com/victorsamun/configvalidator/archive/master.zip", "Homepage": "https://github.com/victorsamun/configvalidator" }, "release_url": "https://pypi.org/project/configchecker/0.95/", "requires_dist": null, "requires_python": null, "summary": "INI-config validator", "version": "0.95" }, "last_serial": 2180896, "releases": { "0.94": [ { "comment_text": "", "digests": { "md5": "217fd39fa510e34e48a9dd1f3595743c", "sha256": "66dfb4293f15672aacc1f1c9b6e6eece16348e0aec4a2e2dc11854dc639b8204" }, "downloads": -1, "filename": "configchecker-0.94-py3-none-any.whl", "has_sig": false, "md5_digest": "217fd39fa510e34e48a9dd1f3595743c", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 4618, "upload_time": "2016-06-17T09:50:47", "url": "https://files.pythonhosted.org/packages/35/60/b7a957219ae2d82393401788a760c0968f89814813ffd933ad8bc04614f0/configchecker-0.94-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "907990fcb8482871699222f94486ba00", "sha256": "cbd7e732c444d7d61633f0e211edd3d072b82c176648860cc5a02ee8e518c0d9" }, "downloads": -1, "filename": "configchecker-0.94.tar.gz", "has_sig": false, "md5_digest": "907990fcb8482871699222f94486ba00", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5463, "upload_time": "2016-06-17T09:50:42", "url": "https://files.pythonhosted.org/packages/36/d9/9569325c67bd55dd284512e05d08ebeaefba8405415fddd96e82f83a8b6e/configchecker-0.94.tar.gz" } ], "0.95": [ { "comment_text": "", "digests": { "md5": "d3e6f4531417a737c65adfa8bac8ab8b", "sha256": "2bd757b24e8026c84ca732b836c10619dd53cf13b676687c2c1dd4ba82aef98b" }, "downloads": -1, "filename": "configchecker-0.95-py3-none-any.whl", "has_sig": false, "md5_digest": "d3e6f4531417a737c65adfa8bac8ab8b", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 6931, "upload_time": "2016-06-22T09:51:01", "url": "https://files.pythonhosted.org/packages/d8/f2/98914f7f813baba67c676c07c257b6a1c0347aa52a3b2b69247c894cf0b6/configchecker-0.95-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd721f8ec84fae5e22ed5620b5966ac3", "sha256": "e810b9dd878c93271db0a0635ba06dceceb159241e551349cc3181d3506ba994" }, "downloads": -1, "filename": "configchecker-0.95.tar.gz", "has_sig": false, "md5_digest": "bd721f8ec84fae5e22ed5620b5966ac3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6913, "upload_time": "2016-06-22T09:50:56", "url": "https://files.pythonhosted.org/packages/b8/f6/3626472e029fb870f95fbf51886c09b24b94f33cc677331e30bd80ef1c54/configchecker-0.95.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d3e6f4531417a737c65adfa8bac8ab8b", "sha256": "2bd757b24e8026c84ca732b836c10619dd53cf13b676687c2c1dd4ba82aef98b" }, "downloads": -1, "filename": "configchecker-0.95-py3-none-any.whl", "has_sig": false, "md5_digest": "d3e6f4531417a737c65adfa8bac8ab8b", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 6931, "upload_time": "2016-06-22T09:51:01", "url": "https://files.pythonhosted.org/packages/d8/f2/98914f7f813baba67c676c07c257b6a1c0347aa52a3b2b69247c894cf0b6/configchecker-0.95-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd721f8ec84fae5e22ed5620b5966ac3", "sha256": "e810b9dd878c93271db0a0635ba06dceceb159241e551349cc3181d3506ba994" }, "downloads": -1, "filename": "configchecker-0.95.tar.gz", "has_sig": false, "md5_digest": "bd721f8ec84fae5e22ed5620b5966ac3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6913, "upload_time": "2016-06-22T09:50:56", "url": "https://files.pythonhosted.org/packages/b8/f6/3626472e029fb870f95fbf51886c09b24b94f33cc677331e30bd80ef1c54/configchecker-0.95.tar.gz" } ] }