{ "info": { "author": "Roy Williams", "author_email": "rwilliams@lyft.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software 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": "*************************************************************\n:fire:toastedmarshmallow:fire:: Makes Marshmallow Toasty Fast\n*************************************************************\n\nToasted Marshmallow implements a JIT for marshmallow that speeds up dumping\nobjects 10-25X (depending on your schema). Toasted Marshmallow allows you to\nhave the great API that\n`Marshmallow `_ provides\nwithout having to sacrifice performance!\n\n::\n\n Benchmark Result:\n Original Time: 2682.61 usec/dump\n Optimized Time: 176.38 usec/dump\n Speed up: 15.21x\n\nEven ``PyPy`` benefits from ``toastedmarshmallow``!\n\n::\n\n Benchmark Result:\n \tOriginal Time: 189.78 usec/dump\n \tOptimized Time: 20.03 usec/dump\n \tSpeed up: 9.48x\n\nInstalling toastedmarshmallow\n-----------------------------\n\n.. code-block:: bash\n\n pip install toastedmarshmallow\n\nThis will *also* install a slightly-forked ``marshmallow`` that includes some\nhooks Toastedmarshmallow needs enable the JIT to run before falling back\nto the original marshmallow code. These changes are minimal making it easier\nto track upstream. You can find the changes\n`Here `_.\n\nThis means you should **remove** ``marshmallow`` from your requirements and\nreplace it with ``toastedmarshmallow``. By default there is no\ndifference unless you explicitly enable Toasted Marshmallow.\n\nEnabling Toasted Marshmallow\n----------------------------\n\nEnabling Toasted Marshmallow on an existing Schema is just one line of code,\nset the ``jit`` property on any ``Schema`` instance to \n``toastedmarshmallow.Jit``. For example:\n\n.. code-block:: python\n\n from datetime import date\n import toastedmarshmallow\n from marshmallow import Schema, fields, pprint\n\n class ArtistSchema(Schema):\n name = fields.Str()\n\n class AlbumSchema(Schema):\n title = fields.Str()\n release_date = fields.Date()\n artist = fields.Nested(ArtistSchema())\n\n schema = AlbumSchema()\n # Specify the jit method as toastedmarshmallow's jit\n schema.jit = toastedmarshmallow.Jit\n # And that's it! Your dump methods are 15x faster!\n\nIt's also possible to use the ``Meta`` class on the ``Marshmallow`` schema\nto specify all instances of a given ``Schema`` should be optimized:\n\n.. code-block:: python\n\n import toastedmarshmallow\n from marshmallow import Schema, fields, pprint\n\n class ArtistSchema(Schema):\n class Meta:\n jit = toastedMarshmallow.Jit\n name = fields.Str()\n\nYou can also enable Toasted Marshmallow globally by setting the environment\nvariable ``MARSHMALLOW_SCHEMA_DEFAULT_JIT`` to ``toastedmarshmallow.Jit`` .\nFuture versions of Toasted Marshmallow may make this the default.\n\nHow it works\n------------\n\nToasted Marshmallow works by generating code at runtime to optimize dumping\nobjects without going through layers and layers of reflection. The generated\ncode optimistically assumes the objects being passed in are schematically valid,\nfalling back to the original marshmallow code on failure.\n\nFor example, taking ``AlbumSchema`` from above, Toastedmarshmallow will\ngenerate the following 3 methods:\n\n.. code-block:: python\n\n def InstanceSerializer(obj):\n res = {}\n value = obj.release_date; value = value() if callable(value) else value; res[\"release_date\"] = _field_release_date__serialize(value, \"release_date\", obj)\n value = obj.artist; value = value() if callable(value) else value; res[\"artist\"] = _field_artist__serialize(value, \"artist\", obj)\n value = obj.title; value = value() if callable(value) else value; value = str(value) if value is not None else None; res[\"title\"] = value\n return res\n\n def DictSerializer(obj):\n res = {}\n if \"release_date\" in obj:\n value = obj[\"release_date\"]; value = value() if callable(value) else value; res[\"release_date\"] = _field_release_date__serialize(value, \"release_date\", obj)\n if \"artist\" in obj:\n value = obj[\"artist\"]; value = value() if callable(value) else value; res[\"artist\"] = _field_artist__serialize(value, \"artist\", obj)\n if \"title\" in obj:\n value = obj[\"title\"]; value = value() if callable(value) else value; value = str(value) if value is not None else None; res[\"title\"] = value\n return res\n\n def HybridSerializer(obj):\n res = {}\n try:\n value = obj[\"release_date\"]\n except (KeyError, AttributeError, IndexError, TypeError):\n value = obj.release_date\n value = value; value = value() if callable(value) else value; res[\"release_date\"] = _field_release_date__serialize(value, \"release_date\", obj)\n try:\n value = obj[\"artist\"]\n except (KeyError, AttributeError, IndexError, TypeError):\n value = obj.artist\n value = value; value = value() if callable(value) else value; res[\"artist\"] = _field_artist__serialize(value, \"artist\", obj)\n try:\n value = obj[\"title\"]\n except (KeyError, AttributeError, IndexError, TypeError):\n value = obj.title\n value = value; value = value() if callable(value) else value; value = str(value) if value is not None else None; res[\"title\"] = value\n return res\n\nToastedmarshmallow will invoke the proper serializer based upon the input.\n\nSince Toastedmarshmallow is generating code at runtime, it's critical you\nre-use Schema objects. If you're creating a new Schema object every time you\nserialize/deserialize an object you'll likely have much worse performance.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lyft/toastedmarshmallow", "keywords": "serialization,rest,json,api,marshal,marshalling,deserialization,validation,schema", "license": "apache2", "maintainer": "", "maintainer_email": "", "name": "toastedmarshmallow", "package_url": "https://pypi.org/project/toastedmarshmallow/", "platform": "", "project_url": "https://pypi.org/project/toastedmarshmallow/", "project_urls": { "Homepage": "https://github.com/lyft/toastedmarshmallow" }, "release_url": "https://pypi.org/project/toastedmarshmallow/2.15.2.post1/", "requires_dist": null, "requires_python": "", "summary": "A JIT implementation for Marshmallow to speed up dumping and loading objects.", "version": "2.15.2.post1" }, "last_serial": 5420826, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5e4b6e1424d7190e7a3f0dd892efc21b", "sha256": "18ef2d75b7bb13f1cec7d3777ee780b7f5242fcba539f6ce30582ab234b17da1" }, "downloads": -1, "filename": "toastedmarshmallow-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5e4b6e1424d7190e7a3f0dd892efc21b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 52435, "upload_time": "2017-08-08T00:34:58", "url": "https://files.pythonhosted.org/packages/ba/71/7867f7ba48a7271ae31c1cf4a3405ce9f5211048c0d506e35a4fc79d2a91/toastedmarshmallow-0.1.0-py2.py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "85312407587db39c50e886b13fa41a5b", "sha256": "5f0f24792198eaf52619aaba27a06ff44d17ee41a054bc92d860e464eab52bf7" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "85312407587db39c50e886b13fa41a5b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 65129, "upload_time": "2017-10-11T23:44:10", "url": "https://files.pythonhosted.org/packages/0b/f2/0bd41df7a818111e300392e26844572300acf5b155bd9801f29b8dad04c9/toastedmarshmallow-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "228a8ec5d54ad76c23ceaab4cbe269a3", "sha256": "c844c57c89498114e6888543bf483018cafd183675193176b75eace63d505a6b" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.0.tar.gz", "has_sig": false, "md5_digest": "228a8ec5d54ad76c23ceaab4cbe269a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59718, "upload_time": "2017-10-11T23:44:13", "url": "https://files.pythonhosted.org/packages/94/22/863fd4584dead948b4dc45f86b2727efdf01dbbdfdda0a2cd3c4f0601598/toastedmarshmallow-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "40f7700bbb3c99acac62b8b4ecd177ac", "sha256": "f887b7a7a0dfba07632dbb82bd292738c18a6426547c61f90b4cc4d55ddd1c4d" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "40f7700bbb3c99acac62b8b4ecd177ac", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 54909, "upload_time": "2017-10-12T20:39:35", "url": "https://files.pythonhosted.org/packages/5f/80/fef2c40e9186aa80829a415478dae86fa9c5cfbc678d99203746e7391d59/toastedmarshmallow-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "179018fae422bc992d0d1929bdfb1120", "sha256": "81ac63873f4533080c9cf0e6277d3ab131103c6efe8ef03835253c851967a19f" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.1-py3.6.egg", "has_sig": false, "md5_digest": "179018fae422bc992d0d1929bdfb1120", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 116550, "upload_time": "2017-10-12T20:39:37", "url": "https://files.pythonhosted.org/packages/78/0e/4d1e0d28226aabd7bcb650ddce625c7a17d096f99a1a4b5fff68392fd97f/toastedmarshmallow-0.2.1-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "f79608f40c8f48714ddddd21bd466c31", "sha256": "fa7e9cf5d4df045d0d0c7230de0f8abdf02a911500c0878c4b75a5dd877031a5" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.1.tar.gz", "has_sig": false, "md5_digest": "f79608f40c8f48714ddddd21bd466c31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 52380, "upload_time": "2017-10-12T20:39:38", "url": "https://files.pythonhosted.org/packages/89/e5/c469b430766ab7025f25002b16ac7062c3f5d090d8ea53566d366148f897/toastedmarshmallow-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "de771a066a312d4e5938624a85b65d74", "sha256": "fc8e3f778a131050f450344022f3c49ee0b733706caf18ddfe1ae44dea384614" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "de771a066a312d4e5938624a85b65d74", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 65447, "upload_time": "2017-10-12T21:53:06", "url": "https://files.pythonhosted.org/packages/40/29/dd77a21c19150390ad4429844bb5a6a4455a0a389b9aa0d1ea82c6ba8c6e/toastedmarshmallow-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0f3290f09368ade6beb3a584533be1be", "sha256": "bfdf4636ed87728ff51999f29133e70b0939b2daacb59b37196f13d9da77960a" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.2.tar.gz", "has_sig": false, "md5_digest": "0f3290f09368ade6beb3a584533be1be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59995, "upload_time": "2017-10-12T21:53:08", "url": "https://files.pythonhosted.org/packages/54/88/2c5c0cf84bdae46fb7424a1ae18f46f8b902462a8df0df19e2e436e343e6/toastedmarshmallow-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "c0d266c088d419bfa686f91e0966797d", "sha256": "787bd5c3b5c187ad000adc24839640a8056d6da6aa7074cd2cbc870947bfd9f1" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c0d266c088d419bfa686f91e0966797d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 65496, "upload_time": "2017-10-12T22:17:42", "url": "https://files.pythonhosted.org/packages/15/be/69b239bb49b49a0c51abf777f6a8d4ae1c0119852d90c2102f5d306b58a2/toastedmarshmallow-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d4e472f6f021e24886435680afe95b0", "sha256": "452db172c95b90bf7c2aa27a154ebcb1b3252a44ae340ef02b88ce6907384b4a" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.3.tar.gz", "has_sig": false, "md5_digest": "5d4e472f6f021e24886435680afe95b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 60075, "upload_time": "2017-10-12T22:17:44", "url": "https://files.pythonhosted.org/packages/3f/fa/a82a4d2bf2c4145736e21dddeb4eff312987f6a4a8784821b9f919d2665d/toastedmarshmallow-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "86c04e070aa3786dfad9a8d9df306be8", "sha256": "777f1d868082384c4fc3886861647d82357ae6d59121a5d84973c2a0766761ab" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "86c04e070aa3786dfad9a8d9df306be8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 65502, "upload_time": "2017-10-13T00:04:00", "url": "https://files.pythonhosted.org/packages/66/98/65b79f95716fac15a0bcf28a31873ba65b9a514b393ab1c68cf9e1efe793/toastedmarshmallow-0.2.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8866d945191bbca231fb0713b82d7746", "sha256": "b22e4ff990229a5320d4276fccafcb60753db4748fb085cad75dd650aa017bc1" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.4.tar.gz", "has_sig": false, "md5_digest": "8866d945191bbca231fb0713b82d7746", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 60091, "upload_time": "2017-10-13T00:04:01", "url": "https://files.pythonhosted.org/packages/f7/a0/1c7ce73e05c266b7d7c616f550bd1472dee814c51d4a2069e1e60878012e/toastedmarshmallow-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "6ba50e10ffb127225b71c2990163487e", "sha256": "397136ff36d3803fdb538ad81fbb10159ff510f300c1b37e44c9d15bda3153f2" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6ba50e10ffb127225b71c2990163487e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 65560, "upload_time": "2017-10-13T01:52:36", "url": "https://files.pythonhosted.org/packages/10/ef/de56108b6a9740c4bf8f06ce37f9aa577a6dcf9fa5085aa01987e7ef9c1a/toastedmarshmallow-0.2.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0ac18c5f5bb060400deb07b4d8483722", "sha256": "7eb59c978411e1a304f52af24b9ef2d91ca57573c0a806c3fcef619ba706d64e" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.5.tar.gz", "has_sig": false, "md5_digest": "0ac18c5f5bb060400deb07b4d8483722", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 60150, "upload_time": "2017-10-13T01:52:38", "url": "https://files.pythonhosted.org/packages/80/22/5a8edcabe8e4b493fea84e908507ec3ff915d5ffa35acc09c374637c3c3b/toastedmarshmallow-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "f34684871499d5c269c76e165780b36a", "sha256": "6f8ecbf287e9745a9b6804a69f001804c98547be9425f06281162b742c8bfd68" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f34684871499d5c269c76e165780b36a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 65797, "upload_time": "2017-10-13T21:35:33", "url": "https://files.pythonhosted.org/packages/4f/e0/4cd56b14d6ef558688ed3ad696c92c612f3749aa4cdbfca5255a1b173591/toastedmarshmallow-0.2.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3e180a26e3c89b77462be5e5d417e687", "sha256": "15dee79cac691c0a1dc9df694b6e014d00d465b588f49b893c9ece27d09856a0" }, "downloads": -1, "filename": "toastedmarshmallow-0.2.6.tar.gz", "has_sig": false, "md5_digest": "3e180a26e3c89b77462be5e5d417e687", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 60351, "upload_time": "2017-10-13T21:35:35", "url": "https://files.pythonhosted.org/packages/d8/c0/8d4bd4dec75d3afcd3227e59345b46645857db1eaa6346b3f177c82d5e95/toastedmarshmallow-0.2.6.tar.gz" } ], "2.15.1": [ { "comment_text": "", "digests": { "md5": "e413e5a01b923e4ba02546079dd8521c", "sha256": "8a759a214f7e92a9a855e7af8a33a90f0438fe552b839a2c8191a8261eab596b" }, "downloads": -1, "filename": "toastedmarshmallow-2.15.1.tar.gz", "has_sig": false, "md5_digest": "e413e5a01b923e4ba02546079dd8521c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 62213, "upload_time": "2019-06-17T23:11:16", "url": "https://files.pythonhosted.org/packages/7e/ce/a89825b7ef897cadbe4b962d75774c3eb8271da6129d89eae4ff5af4aaef/toastedmarshmallow-2.15.1.tar.gz" } ], "2.15.2": [ { "comment_text": "", "digests": { "md5": "e0d4f3a61025458654d806fe725425b3", "sha256": "13174fc15a1ae2776bc28ed1e74f5726851082f951b4482d433d05c38c9d6a92" }, "downloads": -1, "filename": "toastedmarshmallow-2.15.2.tar.gz", "has_sig": false, "md5_digest": "e0d4f3a61025458654d806fe725425b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 62235, "upload_time": "2019-06-18T16:27:23", "url": "https://files.pythonhosted.org/packages/13/2a/74f0abe7ad950c26acf393fdafbb23d7ff155719f6a429de67f62003cb4b/toastedmarshmallow-2.15.2.tar.gz" } ], "2.15.2.post1": [ { "comment_text": "", "digests": { "md5": "9ac2dfaed2d9600452b97099d3f2935d", "sha256": "aad7c89720a27d6362e1362394ceaedf5e1648aba4506c1971da35b3642810e9" }, "downloads": -1, "filename": "toastedmarshmallow-2.15.2.post1.tar.gz", "has_sig": false, "md5_digest": "9ac2dfaed2d9600452b97099d3f2935d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 62254, "upload_time": "2019-06-19T15:18:10", "url": "https://files.pythonhosted.org/packages/17/32/183250558a858f74bbce5faa46054feac73723708ae8f9d9e4c554f62be3/toastedmarshmallow-2.15.2.post1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9ac2dfaed2d9600452b97099d3f2935d", "sha256": "aad7c89720a27d6362e1362394ceaedf5e1648aba4506c1971da35b3642810e9" }, "downloads": -1, "filename": "toastedmarshmallow-2.15.2.post1.tar.gz", "has_sig": false, "md5_digest": "9ac2dfaed2d9600452b97099d3f2935d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 62254, "upload_time": "2019-06-19T15:18:10", "url": "https://files.pythonhosted.org/packages/17/32/183250558a858f74bbce5faa46054feac73723708ae8f9d9e4c554f62be3/toastedmarshmallow-2.15.2.post1.tar.gz" } ] }