{ "info": { "author": "Andrew Seaman", "author_email": "andrewseaman35@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "==================\npy_value_validator\n==================\n\nThis is a Python module that provides an easy way to validate values in\nother projects. The base class provides some generic comparisons and should\nbe overridden in order to define comparisons for other classes.\n\nInstallation\n============\n\nAdd the source as a submodule to your project.\n\n $ git submodule add https://github.com/andrewseaman35/py-value-validator.git\n $ git submodule init\n\nUsage\n=====\n\nBy overriding the functions class, validation functions can be added by data type\nor to the generic function list. Any function that is specified as generic may be\nused by any data of any type being validated.\n\n class ValidatorFunctions(GenericValidatorFunctions):\n def _add_typed_functions(self):\n self._add_function(str, \"contains\", contains)\n self._add_function(\"generic\", \"is_not_none\", is_not_none)\n\n def contains(mine, yours):\n return yours in mine\n\n def is_not_none(mine, yours=None):\n return mine is not None\n\nCreate a validator with an instance of the function class.\n\n _validator_functions = ValidatorFunctions()\n validator = ValueValidator(_validator_functions)\n\nDefine a list of tuples that define the validation for the given value.\n\n validations = [('contains', 'ell'), ('is_not_none', None)]\n\nRun the validations against a value and keep an eye out for a ValidationError.\n\n try:\n validator.validate(\"hello, world!\", validations)\n except ValidationError as validation_error:\n print(\"Value did not pass validation!\")", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/py_value_validator/", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "py-value-validator", "package_url": "https://pypi.org/project/py-value-validator/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/py-value-validator/", "project_urls": { "Homepage": "http://pypi.python.org/pypi/py_value_validator/" }, "release_url": "https://pypi.org/project/py-value-validator/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "Value validation module", "version": "0.0.2" }, "last_serial": 2576260, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d2fcd42e7c38712fb1af40a1bdac3f4f", "sha256": "479bd13c16c7cfb3a4d0012da7953d795ab110e75806ae8ce95268a54a7a68ce" }, "downloads": -1, "filename": "py_value_validator-0.0.2.tar.gz", "has_sig": false, "md5_digest": "d2fcd42e7c38712fb1af40a1bdac3f4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4021, "upload_time": "2017-01-16T00:08:54", "url": "https://files.pythonhosted.org/packages/75/1c/2deb641cd07c399065005187e79830e11b1234ae3896c81cc56cd127ef5a/py_value_validator-0.0.2.tar.gz" } ], "0.0.2": [] }, "urls": [] }