{ "info": { "author": "Douglas Treadwell", "author_email": "douglas.treadwell@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "Marshmallow Factory\n===================\n\n\nInspired by [Voluptuous](https://github.com/alecthomas/voluptuous).\n\nIt's sometimes inconvenient to define named \n[Marshmallow](https://github.com/marshmallow-code/marshmallow)\nSchemas, especially when those schemas are deeply nested.\n\nExample:\n\n```\nclass InnerSchema(Schema):\n inner_bool = Boolean()\n\n\nclass MiddleSchema(Schema):\n middle_int = Integer()\n middle_nested = Nested(InnerSchema)\n\n\nclass OuterSchema(Schema):\n outer_str = String()\n outer_nested = Nested(MiddleSchema)\n\n\nschema_instance = OuterSchema()\nschema_instance.validate(input_)\n```\n\nSo, this library provides a convenient syntax for defining\ndeeply nested Schemas.\n\n```\nfrom marshmallow_factory import schema\n\nOuterSchema = schema({\n 'outer_str': String(),\n 'outer_nested': Nested(schema({\n 'middle_int': Integer(),\n 'middle_nested': Nested(schema({\n 'inner_bool': Boolean()\n }))\n }))\n})\n\nschema_instance = OuterSchema()\nschema_instance.validate(input_)\n```\n\n\nSupport For Meta Options\n------------------------\n\nMeta options are supported using the following syntax:\n\n```\nclass Meta:\n strict = True # or your other options\n\nmy_schema = schema({\n 'Meta': Meta,\n 'str': String()\n})\n```\n\n\nAlternative Syntax\n------------------\n\nSchema factory arguments can also be supplied as keyword\narguments rather than a dictionary.\n\n```\nmy_schema = schema(Meta=Meta, str=String())\n```\n\nFor nested Schemas, plain dictionary literals can be provided\ninstead of Nested(schema({...}).\n\n```\nfrom marshmallow_factory import schema\n\nOuterSchema = schema({\n 'outer_str': String(),\n 'outer_nested': {\n 'middle_int': Integer(),\n 'middle_nested': {\n 'inner_bool': Boolean()\n }\n }\n})\n\nschema_instance = OuterSchema()\nschema_instance.validate(input_)\n```\n\n\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/douglas-treadwell/marshmallow-factory", "keywords": "serialization,rest,json,api,marshal,marshalling,deserialization,validation,schema,model,models,modelling,object,objects", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "marshmallow-factory", "package_url": "https://pypi.org/project/marshmallow-factory/", "platform": "", "project_url": "https://pypi.org/project/marshmallow-factory/", "project_urls": { "Homepage": "https://github.com/douglas-treadwell/marshmallow-factory" }, "release_url": "https://pypi.org/project/marshmallow-factory/0.1.0/", "requires_dist": [ "marshmallow" ], "requires_python": "", "summary": "Convenient anonymous and nested schemas using dict literal syntax for Marshmallow.", "version": "0.1.0" }, "last_serial": 2945994, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "1146c339a2bd45da1fa7e27cc266f3bd", "sha256": "85e93720ec6ac310fc38abfd58cd2fb0ed18b6715cdb72562d020641984c5842" }, "downloads": -1, "filename": "marshmallow_factory-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1146c339a2bd45da1fa7e27cc266f3bd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4208, "upload_time": "2017-06-13T06:10:19", "url": "https://files.pythonhosted.org/packages/93/25/4806405f7e053c1ed9753095716bdc316cda5976ccef62c6e841fbb8aa00/marshmallow_factory-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3c2a82e30ca1138be8157f07e8596d82", "sha256": "33959508dfa0b26713b08eec4dcaace5bf02fdc5a7a38b1b0ef0ceeae519071a" }, "downloads": -1, "filename": "marshmallow_factory-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3c2a82e30ca1138be8157f07e8596d82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2854, "upload_time": "2017-06-13T06:10:20", "url": "https://files.pythonhosted.org/packages/cc/97/5162ba4fa100fe2218e9f1d77b0b497df287dfb8fd70c9e206d8efb6bd33/marshmallow_factory-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1146c339a2bd45da1fa7e27cc266f3bd", "sha256": "85e93720ec6ac310fc38abfd58cd2fb0ed18b6715cdb72562d020641984c5842" }, "downloads": -1, "filename": "marshmallow_factory-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1146c339a2bd45da1fa7e27cc266f3bd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4208, "upload_time": "2017-06-13T06:10:19", "url": "https://files.pythonhosted.org/packages/93/25/4806405f7e053c1ed9753095716bdc316cda5976ccef62c6e841fbb8aa00/marshmallow_factory-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3c2a82e30ca1138be8157f07e8596d82", "sha256": "33959508dfa0b26713b08eec4dcaace5bf02fdc5a7a38b1b0ef0ceeae519071a" }, "downloads": -1, "filename": "marshmallow_factory-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3c2a82e30ca1138be8157f07e8596d82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2854, "upload_time": "2017-06-13T06:10:20", "url": "https://files.pythonhosted.org/packages/cc/97/5162ba4fa100fe2218e9f1d77b0b497df287dfb8fd70c9e206d8efb6bd33/marshmallow_factory-0.1.0.tar.gz" } ] }