{ "info": { "author": "Victor Klapholz", "author_email": "victor.klapholz@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "**********************************************************\n:fire:toastedmarshmallow-enum:fire:: Dumps and Loads Enums\n**********************************************************\n\nInspired by `Marshmallow Enum `_ and by ORM libraries.\n\nThe Toasted Marshmallow Enum package makes it possible to dump and load Enum values based on the ultra fast\nserialization that `Toasted Marshmallow `_ provides.\n\n\nInstalling toastedmarshmallow-enum\n------------------------------------\n\n.. code-block:: bash\n\n pip install toastedmarshmallow-enum\n\n\nUsing Toasted Marshmallow Enum\n--------------------------------\n\nUsing Toasted Marshmallow Enum in an existing ``Marshmallow Schema`` is as easy as defining the enum class attribute\nas an ``EnumField``. For example:\n\n.. code-block:: python\n\n from enum import Enum\n\n import toastedmarshmallow\n from marshmallow import fields, Schema\n\n from toastedmarshmallow_enum import EnumField\n\n class Level(Enum):\n LOW = '0'\n MEDIUM = '1'\n HIGH = '2'\n\n class UserSchema(Schema):\n class Meta:\n jit = toastedmarshmallow.Jit\n\n name = fields.String()\n level = EnumField(Level)\n\n\nHow it works\n------------\n\n``Dump methods:``\n\n.. code-block:: python\n\n class User:\n def __init(name, level):\n self.name = name\n self.level = level\n\n schema = DummyUserSchema()\n\n user = User(name='John Doe', level=Level.HIGH)\n print(schema.dump(user).data)\n # {'name': 'John Doe', 'level': 2}\n\n print(schema.load({'name': 'John Doe', 'level: 2}).data)\n # {'name': 'John Doe', 'level': 'HIGH'}\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/py-ddd/toastedmarshmallow-enum", "keywords": "serialization", "license": "apache2", "maintainer": "", "maintainer_email": "", "name": "toastedmarshmallow-enum", "package_url": "https://pypi.org/project/toastedmarshmallow-enum/", "platform": "", "project_url": "https://pypi.org/project/toastedmarshmallow-enum/", "project_urls": { "Homepage": "https://gitlab.com/py-ddd/toastedmarshmallow-enum" }, "release_url": "https://pypi.org/project/toastedmarshmallow-enum/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "The Toasted Marshmallow Enum package makes it possible to dump and load Enum values based on the ultra fast serialization that Toasted Marshmallow provides.", "version": "1.0.1" }, "last_serial": 3725805, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "444a3cb33045219762955cc1f38c8ea2", "sha256": "e7b9194741cc577f3384e58d9a94b7507482a97a9aea9efc7238ce4c51b1bcd7" }, "downloads": -1, "filename": "toastedmarshmallow-enum-1.0.0.tar.gz", "has_sig": false, "md5_digest": "444a3cb33045219762955cc1f38c8ea2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2844, "upload_time": "2018-03-23T21:33:10", "url": "https://files.pythonhosted.org/packages/95/3c/5897bcb81eb47ca6f9e45bd4b4411e8f6346348cf93469886c99457f7c2d/toastedmarshmallow-enum-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "afb8e1aa210bcdf377bcf1c6fbb3227f", "sha256": "b4058a7f29e0a1210e5f52650b75858f77a01ec255d659793c0e52f57ddc9eb7" }, "downloads": -1, "filename": "toastedmarshmallow-enum-1.0.1.tar.gz", "has_sig": false, "md5_digest": "afb8e1aa210bcdf377bcf1c6fbb3227f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2812, "upload_time": "2018-04-02T08:34:26", "url": "https://files.pythonhosted.org/packages/b2/23/59f407d89275e392b9ab3cb5c9c7ebf16312cd4f3eaa28f9f92bced10091/toastedmarshmallow-enum-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "afb8e1aa210bcdf377bcf1c6fbb3227f", "sha256": "b4058a7f29e0a1210e5f52650b75858f77a01ec255d659793c0e52f57ddc9eb7" }, "downloads": -1, "filename": "toastedmarshmallow-enum-1.0.1.tar.gz", "has_sig": false, "md5_digest": "afb8e1aa210bcdf377bcf1c6fbb3227f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2812, "upload_time": "2018-04-02T08:34:26", "url": "https://files.pythonhosted.org/packages/b2/23/59f407d89275e392b9ab3cb5c9c7ebf16312cd4f3eaa28f9f92bced10091/toastedmarshmallow-enum-1.0.1.tar.gz" } ] }