{ "info": { "author": "TakesxiSximada", "author_email": "takesxi.sximada@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "Natural Language :: English", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4" ], "description": "vjson\n\n0.1.0\n\nvjson creates an object to serialize the only of the type specified in JSONSchema. It works like a json module.\n\ninstall\n===========\n\nNext, execute command.::\n\n $ pip install vjson\n\n\nHow to use\n==========\n\nYou define an object using JSONSchema.::\n\n >>> import vjson\n >>> _json = vjson.ValidatedJSON({\n ... 'type': 'object',\n ... 'properties': {\n ... 'price': {'type': 'number'},\n ... 'name': {'type': 'string'},\n ... },\n ... })\n\nThis object can dumps/loads()/dump()/load() the serializable object, as in the json module.::\n\n >>> _json.loads('{\"name\" : \"Eggs\", \"price\" : 34.99}')\n {'name': 'Eggs', 'price': 34.99}\n >>> _json.dumps({\"name\": \"Eggs\", \"price\": 34.99})\n '{\"name\": \"Eggs\", \"price\": 34.99}'\n\nIf you try to pass the data that violates the JSONSchema that was specified in the constructor, it raises a vjson.JSONValidationError.::\n\n >>> _json.loads('{\"name\" : \"Eggs\", \"price\" : \"34.99\"}')\n Traceback (most recent call last):\n File \"/tmp/test/var/src/develop/vjson/src/vjson/__init__.py\", line 32, in _wrap\n jsonschema.validate(data, schema)\n File \"/tmp/test/env/lib/python3.4/site-packages/jsonschema/validators.py\", line 478, in validate\n cls(schema, *args, **kwargs).validate(instance)\n File \"/tmp/test/env/lib/python3.4/site-packages/jsonschema/validators.py\", line 123, in validate\n raise error\n jsonschema.exceptions.ValidationError: '34.99' is not of type 'number'\n\n Failed validating 'type' in schema['properties']['price']:\n {'type': 'number'}\n\n On instance['price']:\n '34.99'\n\n During handling of the above exception, another exception occurred:\n\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"/tmp/test/var/src/develop/vjson/src/vjson/__init__.py\", line 34, in _wrap\n raise JSONValidationError(err)\n vjson.JSONValidationError: '34.99' is not of type 'number'\n\n Failed validating 'type' in schema['properties']['price']:\n {'type': 'number'}\n\n On instance['price']:\n '34.99'\n >>>", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/TakesxiSximada/vjson/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/TakesxiSximada/vjson", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "vjson", "package_url": "https://pypi.org/project/vjson/", "platform": "any", "project_url": "https://pypi.org/project/vjson/", "project_urls": { "Download": "https://github.com/TakesxiSximada/vjson/master.zip", "Homepage": "https://github.com/TakesxiSximada/vjson" }, "release_url": "https://pypi.org/project/vjson/0.1/", "requires_dist": null, "requires_python": null, "summary": "vjson creates an object to serialize the only of the type specified in JSONSchema. It works like a json module.", "version": "0.1" }, "last_serial": 1713415, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "1aead9ce2c8a9b47c76a9ebf7d30e299", "sha256": "fcfdaaba3ea858a096bdba68cdeaba7b0197b0514b07b796c2fc79ff93af914a" }, "downloads": -1, "filename": "vjson-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1aead9ce2c8a9b47c76a9ebf7d30e299", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 6291, "upload_time": "2015-09-08T15:13:02", "url": "https://files.pythonhosted.org/packages/4a/49/5a0d31034da153362f9209752757819812f618d96fa527695140912f936a/vjson-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5ff5576be60ab1e54d5af27c2ca70926", "sha256": "84cf1f2e293fda30c255dcd338d1492822c478fbb00f162a0e5265b8863e818a" }, "downloads": -1, "filename": "vjson-0.1.tar.gz", "has_sig": false, "md5_digest": "5ff5576be60ab1e54d5af27c2ca70926", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3993, "upload_time": "2015-09-08T15:13:11", "url": "https://files.pythonhosted.org/packages/e1/28/3e0c609365ca5e6dd2d83e8d176a8393f09d22f51f53a02bbb847cc912c6/vjson-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1aead9ce2c8a9b47c76a9ebf7d30e299", "sha256": "fcfdaaba3ea858a096bdba68cdeaba7b0197b0514b07b796c2fc79ff93af914a" }, "downloads": -1, "filename": "vjson-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1aead9ce2c8a9b47c76a9ebf7d30e299", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 6291, "upload_time": "2015-09-08T15:13:02", "url": "https://files.pythonhosted.org/packages/4a/49/5a0d31034da153362f9209752757819812f618d96fa527695140912f936a/vjson-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5ff5576be60ab1e54d5af27c2ca70926", "sha256": "84cf1f2e293fda30c255dcd338d1492822c478fbb00f162a0e5265b8863e818a" }, "downloads": -1, "filename": "vjson-0.1.tar.gz", "has_sig": false, "md5_digest": "5ff5576be60ab1e54d5af27c2ca70926", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3993, "upload_time": "2015-09-08T15:13:11", "url": "https://files.pythonhosted.org/packages/e1/28/3e0c609365ca5e6dd2d83e8d176a8393f09d22f51f53a02bbb847cc912c6/vjson-0.1.tar.gz" } ] }