{ "info": { "author": "M69k65y", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Flask", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3" ], "description": "## JSON Simple Validator\n\n### About\nThis is a simple JSON validator built for and tested using Flask applications.\n\n\n### Usage\nTo install the validator:\n\n pip install json-simple-validator\n\nSample usage of the validator:\n\n```python\nfrom json_simple_validator import field_validation\n\n\n## Example Flask request\n@app.route(\"/post\", methods = [\"POST\"])\ndef post():\n\tvalidation_list = [\n\t\t{\"field\": \"name\"},\n {\"field\": \"pass\", \"alias\": \"Password\"},\n {\"field\": \"number\", \"var_type\": [int]}\n\t]\n\n# \tvalidation_list = [\n# \t\t# Each element is made up of the field that is being validated\n# \t\t# and the alias of the field that is to be displayed, should there be an error\n\n# \t\t# Sample dict:\n# \t\t# {\"name\": \"\", e.g \"first_name\"\n# \t\t# \"alias[optional]\": \"\", eg \"First Name\" If left out, title case of field name is used\n# \t\t# \"var_type[optional]\": \"\", eg [str, bool, int]\n# \t\t# \"length[optional]\": \"[min, max(optional)]\", eg [2, 10]\n# \t\t# \"special_rules\": \"\"} eg [\"email\"] Only email is supported for now\n\n\tmessages = fieldValidation(request.json, validation_list)\n\n\tif messages:\n\t\treturn jsonify({\"messages\": messages}), 422\n\n```\n\nPost the following to the above endpoint:\n```json\n{\n\t\"name\": \"\",\n\t\"pass\": \"\",\n\t\"number\": \"121231\"\n}\n```\n\nThe following is returned:\n```json\n{\n\t\"messages\": [\n \"Name is empty.\",\n \"Password is empty.\",\n \"Number data type is not of the expected data type.\"\n ]\n}\n```\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/M69k65y/json-simple-validator", "keywords": "flask json validation validator", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "json-simple-validator", "package_url": "https://pypi.org/project/json-simple-validator/", "platform": "", "project_url": "https://pypi.org/project/json-simple-validator/", "project_urls": { "Homepage": "https://github.com/M69k65y/json-simple-validator" }, "release_url": "https://pypi.org/project/json-simple-validator/1.0.1/", "requires_dist": [ "phonenumbers" ], "requires_python": "", "summary": "A simple JSON validator for use in Flask projects. (Built in Python 3)", "version": "1.0.1" }, "last_serial": 4581792, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "bde59035367effa7122480cea36fe209", "sha256": "2ce327991407742561ed66f6733e44b958c59d2ab5ffc01e3c40ee8e76d27c0b" }, "downloads": -1, "filename": "json_simple_validator-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "bde59035367effa7122480cea36fe209", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4554, "upload_time": "2018-12-10T17:19:07", "url": "https://files.pythonhosted.org/packages/7d/2f/3f929489f954deafe0871e61f7eeafa671cb514efdd14acf2f1872c0ac5d/json_simple_validator-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1659158ee92ffe27b087817ba7bf5a2f", "sha256": "b0c20ac215f824a11d78603a5c1e874e8157fb6e69b5f259a899895da4a2cc60" }, "downloads": -1, "filename": "json-simple-validator-1.0.tar.gz", "has_sig": false, "md5_digest": "1659158ee92ffe27b087817ba7bf5a2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3547, "upload_time": "2018-12-10T17:19:09", "url": "https://files.pythonhosted.org/packages/34/7d/71fe5ca70f13b5927b4af9199916c79bfd110685f58dcc916d2378887305/json-simple-validator-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "734a9ae65cbdc85742a7dc2f32efb92d", "sha256": "00d79c02e8fde04be64f71bcc4f9fb0a82b4b882ffd9f343eafff5cafed066bf" }, "downloads": -1, "filename": "json_simple_validator-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "734a9ae65cbdc85742a7dc2f32efb92d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5220, "upload_time": "2018-12-10T17:27:26", "url": "https://files.pythonhosted.org/packages/be/31/d48101e7357edeca4f832a862c2df24e8522d608965be2aa299ceaef15bd/json_simple_validator-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ebbd4527f7a726a90cde81c00a895f73", "sha256": "cfe9763aa66f7bb3c5542c6d8b009e4f47c73ad5c8a00976a3ef70a190adf9de" }, "downloads": -1, "filename": "json-simple-validator-1.0.1.tar.gz", "has_sig": false, "md5_digest": "ebbd4527f7a726a90cde81c00a895f73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3769, "upload_time": "2018-12-10T17:27:27", "url": "https://files.pythonhosted.org/packages/3e/99/5b406bdee67ea7e09816c4144e94ea7cd7eebf0d4e3e8e0459913811090b/json-simple-validator-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "734a9ae65cbdc85742a7dc2f32efb92d", "sha256": "00d79c02e8fde04be64f71bcc4f9fb0a82b4b882ffd9f343eafff5cafed066bf" }, "downloads": -1, "filename": "json_simple_validator-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "734a9ae65cbdc85742a7dc2f32efb92d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5220, "upload_time": "2018-12-10T17:27:26", "url": "https://files.pythonhosted.org/packages/be/31/d48101e7357edeca4f832a862c2df24e8522d608965be2aa299ceaef15bd/json_simple_validator-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ebbd4527f7a726a90cde81c00a895f73", "sha256": "cfe9763aa66f7bb3c5542c6d8b009e4f47c73ad5c8a00976a3ef70a190adf9de" }, "downloads": -1, "filename": "json-simple-validator-1.0.1.tar.gz", "has_sig": false, "md5_digest": "ebbd4527f7a726a90cde81c00a895f73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3769, "upload_time": "2018-12-10T17:27:27", "url": "https://files.pythonhosted.org/packages/3e/99/5b406bdee67ea7e09816c4144e94ea7cd7eebf0d4e3e8e0459913811090b/json-simple-validator-1.0.1.tar.gz" } ] }