{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "*********************************************\nserpy: ridiculously fast object serialization\n*********************************************\n\n\n**serpy** is a super simple object serialization framework built for speed.\n**serpy** serializes complex datatypes (Django Models, custom classes, ...) to\nsimple native types (dicts, lists, strings, ...). The native types can easily\nbe converted to JSON or any other format needed.\n\nThe goal of **serpy** is to be able to do this *simply*, *reliably*, and\n*quickly*. Since serializers are class based, they can be combined, extended\nand customized with very little code duplication. Compared to other popular\nPython serialization frameworks like `marshmallow\n`_ or `Django Rest Framework Serializers\n`_ **serpy** is at\nleast an `order of magnitude\n`_ faster.\n\n\nThis is a forked version that include de possibility to remove None field from the output.\nIt is recommanded that you used the upstream version available at https://github.com/clarkduvall/serpy\n\n\nSource\n======\nSource at: https://github.com/clarkduvall/serpy\n\nIf you want a feature, send a pull request!\n\nDocumentation\n=============\nFull documentation at: http://serpy.readthedocs.org/en/latest/\n\nInstallation\n============\n.. code-block:: bash\n\n $ pip install serpy\n\nExamples\n========\n\nSimple Example\n--------------\n.. code-block:: python\n\n import serpy\n\n class Foo(object):\n \"\"\"The object to be serialized.\"\"\"\n y = 'hello'\n z = 9.5\n\n def __init__(self, x):\n self.x = x\n\n\n class FooSerializer(serpy.Serializer):\n \"\"\"The serializer schema definition.\"\"\"\n # Use a Field subclass like IntField if you need more validation.\n x = serpy.IntField()\n y = serpy.Field()\n z = serpy.Field()\n\n f = Foo(1)\n FooSerializer(f).data\n # {'x': 1, 'y': 'hello', 'z': 9.5}\n\n fs = [Foo(i) for i in range(100)]\n FooSerializer(fs, many=True).data\n # [{'x': 0, 'y': 'hello', 'z': 9.5}, {'x': 1, 'y': 'hello', 'z': 9.5}, ...]\n\nNested Example\n--------------\n.. code-block:: python\n\n import serpy\n\n class Nestee(object):\n \"\"\"An object nested inside another object.\"\"\"\n n = 'hi'\n\n\n class Foo(object):\n x = 1\n nested = Nestee()\n\n\n class NesteeSerializer(serpy.Serializer):\n n = serpy.Field()\n\n\n class FooSerializer(serpy.Serializer):\n x = serpy.Field()\n # Use another serializer as a field.\n nested = NesteeSerializer()\n\n f = Foo()\n FooSerializer(f).data\n # {'x': 1, 'nested': {'n': 'hi'}}\n\nComplex Example\n---------------\n.. code-block:: python\n\n import serpy\n\n class Foo(object):\n y = 1\n z = 2\n super_long_thing = 10\n\n def x(self):\n return 5\n\n\n class FooSerializer(serpy.Serializer):\n w = serpy.Field(attr='super_long_thing')\n x = serpy.Field(call=True)\n plus = serpy.MethodField()\n\n def get_plus(self, obj):\n return obj.y + obj.z\n\n f = Foo()\n FooSerializer(f).data\n # {'w': 10, 'x': 5, 'plus': 3}\n\nInheritance Example\n-------------------\n.. code-block:: python\n\n import serpy\n\n class Foo(object):\n a = 1\n b = 2\n\n\n class ASerializer(serpy.Serializer):\n a = serpy.Field()\n\n\n class ABSerializer(ASerializer):\n \"\"\"ABSerializer inherits the 'a' field from ASerializer.\n\n This also works with multiple inheritance and mixins.\n \"\"\"\n b = serpy.Field()\n\n f = Foo()\n ASerializer(f).data\n # {'a': 1}\n ABSerializer(f).data\n # {'a': 1, 'b': 2}\n\nLicense\n=======\nserpy is free software distributed under the terms of the MIT license. See the\n`LICENSE `_ file.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/canaltp/serpy", "keywords": "serialization,rest,json,api,marshal,marshalling,validation,schema,fast", "license": "MIT", "maintainer": "canaltp", "maintainer_email": "navitia@canaltp.fr", "name": "serpy-ctp", "package_url": "https://pypi.org/project/serpy-ctp/", "platform": "", "project_url": "https://pypi.org/project/serpy-ctp/", "project_urls": { "Homepage": "https://github.com/canaltp/serpy" }, "release_url": "https://pypi.org/project/serpy-ctp/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "ridiculously fast object serialization fork by canaltp", "version": "0.2.1" }, "last_serial": 5910547, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "bd329cc694d3678add9cdb007f6ada2b", "sha256": "143c687c5a7474ff869c7e5559aac3e0f67c45c2683aa8b0c7a7152aff954307" }, "downloads": -1, "filename": "serpy-ctp-0.2.0.tar.gz", "has_sig": false, "md5_digest": "bd329cc694d3678add9cdb007f6ada2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6233, "upload_time": "2019-10-01T05:41:51", "url": "https://files.pythonhosted.org/packages/53/d4/36f1f5691164e2387d705860e93c221b78473b1d431eb8bbb7dd84be7cd1/serpy-ctp-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "de2085d2a51ac6e9ec603a480af4b620", "sha256": "673751427943828b226f599dddf3d84909015b523e5cdcc73f4c290b791ff200" }, "downloads": -1, "filename": "serpy-ctp-0.2.1.tar.gz", "has_sig": false, "md5_digest": "de2085d2a51ac6e9ec603a480af4b620", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6266, "upload_time": "2019-10-01T05:56:06", "url": "https://files.pythonhosted.org/packages/95/c7/5609fb1f65972c60a497c3d0ab5ea548ce250b0df1ee625ab9b2163fc463/serpy-ctp-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de2085d2a51ac6e9ec603a480af4b620", "sha256": "673751427943828b226f599dddf3d84909015b523e5cdcc73f4c290b791ff200" }, "downloads": -1, "filename": "serpy-ctp-0.2.1.tar.gz", "has_sig": false, "md5_digest": "de2085d2a51ac6e9ec603a480af4b620", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6266, "upload_time": "2019-10-01T05:56:06", "url": "https://files.pythonhosted.org/packages/95/c7/5609fb1f65972c60a497c3d0ab5ea548ce250b0df1ee625ab9b2163fc463/serpy-ctp-0.2.1.tar.gz" } ] }