{ "info": { "author": "Luo Xiaojie", "author_email": "xiaojieluoff@gmail.com", "bugtrack_url": null, "classifiers": [], "description": " Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\nDescription: vlde: easy-to-use for validate data\n =========\n .. image:: https://img.shields.io/pypi/v/vlde.svg\n :target: https://pypi.org/project/vlde/\n \n .. image:: https://img.shields.io/pypi/l/vlde.svg\n :target: https://pypi.org/project/vlde/\n \n .. image:: https://travis-ci.org/xiaojieluo/vlde.svg?branch=master\n :target: https://travis-ci.org/xiaojieluo/vlde\n \n .. image:: https://codecov.io/gh/xiaojieluo/vlde/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/xiaojieluo/vlde\n \n \u4f7f\u7528\n -----\n \n .. code-block:: python\n \n from vlde import Validator\n \n v = Validator(return_format='object')\n result = v.set_rules('hello', 'required|dict|max_length:3')\n if result.status is False:\n print('\\n'.join(result.error))\n \n \u6216\u8005\u6355\u83b7\u5f02\u5e38\uff1a\n \n .. code-block:: python\n \n from vlde import ValidateError, Validator\n \n v = Validator(return_format='exception')\n try:\n v.set_rules('hello', 'required|dict')\n except ValidateError as e:\n print(e)\n \n \u5f00\u542f\u89c4\u5219\u9519\u8bef\u63d0\u793a\n --------------\n \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u82e5\u4f20\u5165\u9519\u8bef\u7684\u89c4\u5219\u540d\u79f0\uff0c vlde \u4f1a\u627e\u4e0d\u5230\u9a8c\u8bc1\u89c4\u5219\uff0c\u5e76\u8fd4\u56de\u9a8c\u8bc1\u901a\u8fc7\u3002\u5982\u679c\u60f3\u5173\u95ed\u6b64\u529f\u80fd\uff0c\u53ea\u9700\u8981\u5728\u5b9a\u4e49\u53d8\u91cf\u65f6\uff0c\u4f20\u5165 `warning_rule = True` \u5373\u53ef\n \n .. code-block:: python\n \n from vlde import ValidateError, Validator, RulesError\n \n v = Validator(warning_rule=True)\n try:\n v.set_rules('hello' 'strssss')\n except RulesError as e:\n print(e)\n \n \u4e5f\u53ef\u4ee5\u4e3a\u5355\u4e2a\u7684 set_rules \u5355\u72ec\u8bbe\u7f6e warning_rule:\n \n .. code-block:: python\n \n from vlde import ValidateError, Validator\n \n v = Validator()\n v.set_rules('hello', 'strssss', warning_rule=False)\n try:\n v.set_rules('hello', 'strssss', warning_rule=True)\n except RulesError as e:\n print(e)\n \n \n validate \u5185\u7f6e\u89c4\u5219\n ------------------------\n \n \u89c4\u5219\u53c2\u8003\n ^^^^^^^^^^^^^\n \n \u4e0b\u8868\u5217\u51fa\u4e86 vlde \u53ef\u7528\u7684\u89c4\u5219\n \n +--------------+------+----------------------------------------+---------------------------------------------------+\n | \u89c4\u5219 | \u53c2\u6570 | \u63cf\u8ff0 | \u4f8b\u5b50 |\n +==============+======+========================================+===================================================+\n | required | | \u5982\u679c\u53d8\u91cf\u503c\u4e3a\u7a7a\u6216\u8005\u4e3a None, \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules(None, 'required')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | min_length | int | \u5982\u679c\u53d8\u91cf\u503c\u957f\u5ea6\u5c0f\u4e8e\u53c2\u6570\u503c, \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules('hello','min_length:6')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | max_length | int | \u5982\u679c\u53d8\u91cf\u503c\u957f\u5ea6\u5927\u4e8e\u53c2\u6570\u503c, \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules('hello', 'max_length:2')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | exact_length | int | \u5982\u679c\u53d8\u91cf\u503c\u957f\u5ea6\u4e0d\u7b49\u4e8e\u53c2\u6570\u503c, \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules('hello', 'exact_length:5')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | in_list | list | \u5982\u679c\u53d8\u91cf\u503c\u4e0d\u5728\u89c4\u5b9a\u7684\u5217\u8868\u4e2d\uff0c\u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules('hello', 'in_list[hello, helloss]')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | str | | \u5982\u679c\u53d8\u91cf\u7c7b\u578b\u4e0d\u4e3a str\uff0c \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules('hello', 'str')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | dict | | \u5982\u679c\u53d8\u91cf\u7c7b\u578b\u4e0d\u4e3a dict\uff0c \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules({'name':'luo'}, 'dict')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | list | | \u5982\u679c\u53d8\u91cf\u7c7b\u578b\u4e0d\u4e3a list\uff0c \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules([1, 2, 3], 'list')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | bool | | \u5982\u679c\u53d8\u91cf\u7c7b\u578b\u4e0d\u4e3a bool\uff0c \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules(True, 'bool')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | float | | \u5982\u679c\u53d8\u91cf\u7c7b\u578b\u4e0d\u4e3a foat\uff0c \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules(1.1,'float')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | int,integer | | \u5982\u679c\u53d8\u91cf\u7c7b\u578b\u4e0d\u4e3a int\uff0c \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules(10, 'int')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | tuple, tup | | \u5982\u679c\u53d8\u91cf\u7c7b\u578b\u4e0d\u4e3a tuple\uff0c \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules((1, 2, 3), 'tuple')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | ipv4 | str | \u5982\u679c\u53d8\u91cf\u503c\u4e0d\u4e3a ipv4 \u5730\u5740, \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules('192.168.1.1', 'ipv4')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | ipv6 | str | \u5982\u679c\u53d8\u91cf\u503c\u4e0d\u4e3a ipv6 \u5730\u5740, \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules('5e:0:0:0:0:0:5668:eeee', 'ipv6')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n | email | str | \u5982\u679c\u53d8\u91cf\u503c\u4e0d\u4e3a\u90ae\u7bb1\u5730\u5740, \u9a8c\u8bc1\u4e0d\u901a\u8fc7 | `v.set_rules('xiaojieluoff@gmail.com' 'email')` |\n +--------------+------+----------------------------------------+---------------------------------------------------+\n \n \u89c4\u5219\u5bb9\u9519\n ^^^^^^\n * `int , integer` \u90fd\u6307\u4ee3 int \u7c7b\u578b\n * `tuple, tup` \u90fd\u6307\u4ee3 tuple \u7c7b\u578b\n \nKeywords: simple data validate library\nPlatform: UNKNOWN\nClassifier: Development Status :: 4 - Beta\nClassifier: Intended Audience :: Developers\nClassifier: Natural Language :: English\nClassifier: License :: OSI Approved :: Apache Software License\nClassifier: Programming Language :: Python\nClassifier: Programming Language :: Python :: 3\nClassifier: Programming Language :: Python :: 3.3\nClassifier: Programming Language :: Python :: 3.4\nClassifier: Programming Language :: Python :: 3.5\nClassifier: Programming Language :: Python :: 3.6\nClassifier: Programming Language :: Python :: Implementation :: CPython\nClassifier: Programming Language :: Python :: Implementation :: PyPy\nRequires-Python: >=3\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/xiaojieluo/vlde", "keywords": "", "license": "Copyright 2017 Luo Xiaojie", "maintainer": "", "maintainer_email": "", "name": "vlde", "package_url": "https://pypi.org/project/vlde/", "platform": "", "project_url": "https://pypi.org/project/vlde/", "project_urls": { "Homepage": "https://github.com/xiaojieluo/vlde" }, "release_url": "https://pypi.org/project/vlde/0.3.0/", "requires_dist": null, "requires_python": "", "summary": "A data integrity check library", "version": "0.3.0" }, "last_serial": 3076111, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "4ffe727bcd0812f1efe4fb8b79839891", "sha256": "fc52ed1b9b0ec1649d708ed96bf61996c31f45fbeba9c8fddf7d44f0a873fc31" }, "downloads": -1, "filename": "vlde-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4ffe727bcd0812f1efe4fb8b79839891", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10184, "upload_time": "2017-07-09T00:23:09", "url": "https://files.pythonhosted.org/packages/56/42/1fa1fe6b39bd1c9c345e7625a546d9fdac7e10b2956ef0f9499af5cbc634/vlde-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16eab3f7a0ea22d6942c2e0c9ebf0ab9", "sha256": "4386cdd8dde6d7b7e821cd06062138937c6320387e62f8dcf3ff6426fba8fcfc" }, "downloads": -1, "filename": "vlde-0.0.1.tar.gz", "has_sig": false, "md5_digest": "16eab3f7a0ea22d6942c2e0c9ebf0ab9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10336, "upload_time": "2017-07-09T00:23:10", "url": "https://files.pythonhosted.org/packages/1a/bf/ce00bc58ee81b70bd0fab7e7417f8ca4197c66cab42ad92e0080b25c505f/vlde-0.0.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "c72eebe5b0a1657da9a388fd9cd97d87", "sha256": "870c822d2f71165297bf7412946a2daba25f73a29d9bfd42ea6e77bd8c2fde36" }, "downloads": -1, "filename": "vlde-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c72eebe5b0a1657da9a388fd9cd97d87", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10265, "upload_time": "2017-07-09T00:49:17", "url": "https://files.pythonhosted.org/packages/45/e0/6cde04023d892d022919fffe4e0c9ed6a2118c652d7fbb9bab7f00781d2e/vlde-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "421b8d76738edd35d8c67e01ab4da031", "sha256": "f21b04e23115267e31ca3235b13d888a87f6616afaac26eb6c9cfcaf6206cd6d" }, "downloads": -1, "filename": "vlde-0.2.0.tar.gz", "has_sig": false, "md5_digest": "421b8d76738edd35d8c67e01ab4da031", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10542, "upload_time": "2017-07-09T00:49:18", "url": "https://files.pythonhosted.org/packages/8e/6a/92f04e8debc2d861609f35eb27cc3d5406504e32437781bf381edf544fbb/vlde-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "cea2e025d0f2c4a25505f386b46abdb0", "sha256": "924e7143b090b8a1dbdbc84cebc1b0a4ed6f36373b7fbe40cd2076f0f9e767d1" }, "downloads": -1, "filename": "vlde-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "cea2e025d0f2c4a25505f386b46abdb0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10398, "upload_time": "2017-08-06T06:23:29", "url": "https://files.pythonhosted.org/packages/39/6c/c02d2f9645289d0fc5fd85684bdd8ac240b22386acf3fa2d0aff3f1d4c29/vlde-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "22049953b211dc31e419989b355be7d4", "sha256": "e5def80ff63028da6742959096d056c240f835bf344bb57f940ffd00117e49f2" }, "downloads": -1, "filename": "vlde-0.3.0.tar.gz", "has_sig": false, "md5_digest": "22049953b211dc31e419989b355be7d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10693, "upload_time": "2017-08-06T06:23:31", "url": "https://files.pythonhosted.org/packages/f1/97/0a4d4a2085d1accd066ec580b5bb9822c1fb349bd1edf7b63b5a0c31acda/vlde-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cea2e025d0f2c4a25505f386b46abdb0", "sha256": "924e7143b090b8a1dbdbc84cebc1b0a4ed6f36373b7fbe40cd2076f0f9e767d1" }, "downloads": -1, "filename": "vlde-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "cea2e025d0f2c4a25505f386b46abdb0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10398, "upload_time": "2017-08-06T06:23:29", "url": "https://files.pythonhosted.org/packages/39/6c/c02d2f9645289d0fc5fd85684bdd8ac240b22386acf3fa2d0aff3f1d4c29/vlde-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "22049953b211dc31e419989b355be7d4", "sha256": "e5def80ff63028da6742959096d056c240f835bf344bb57f940ffd00117e49f2" }, "downloads": -1, "filename": "vlde-0.3.0.tar.gz", "has_sig": false, "md5_digest": "22049953b211dc31e419989b355be7d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10693, "upload_time": "2017-08-06T06:23:31", "url": "https://files.pythonhosted.org/packages/f1/97/0a4d4a2085d1accd066ec580b5bb9822c1fb349bd1edf7b63b5a0c31acda/vlde-0.3.0.tar.gz" } ] }