{ "info": { "author": "Dan Newcome", "author_email": "dnewcome@circleup.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: BSD License", "Topic :: Software Development :: Libraries" ], "description": "# About\n\nFine-grained control of JSON serialization using decorators.\n\n# Why\n\nBecause sometimes you just need to serialize a few properties/exclude\nnull values/rename fields and want to do it declaratively.\n\n# Usage\n\nImports\n\n from jsonprop import JsonObject, json_property\n\nInherit from JsonObject\n\n class MyJsonObjectClass(JsonObject):\n def __init__(self):\n self._test_prop = None\n\nDecorate getter method with @json_property\n\n ...\n @json_property('json_test_prop', False)\n def get_test_prop(self):\n return self._test_prop \n\nuse json() method inherited from JsonObject to serialize\n\n json = myclass.json()\n\nAlternatively, use the json_field to concisely specify a set of serializable fields\non an object that may be assigned to as descriptors.\n\n class MyObj(JsonObject):\n field_one = json_field('fieldOne')\n field_two = json_field('fieldTwo')\n\nWhich may be serialized in the same manner as above.\n\nJsonObject supports the use of keyword arguments at object initialization time. The\nexample class above may be conveniently instantiated as follows:\n\n myobj = MyObj(field_one = 'one', field_two = 'two')\n\n\n# API\n\nThe general form of the decorator is:\n\n @json_property(name, include_null)\n\nwhere name is the desired JSON field name for the python property and \ninclude_null is a boolean that indicates whether or not null values will \nbe included in the serialization. By default this value is True and null values\nwill be serialized. If this is set to False, the field will be omitted entirely\nin the serialized JSON output in the event that the value of the field is\nNone.\n\nThe decorator may be applied without arguments, in which case the field \nwill not be renamed and nulls will be serialized. Note that the property\ndecorator must be called as a constructor, i.e. using empty parens `()'\n\n @json_property()\n\n\n# Hacking\n\nSerializing properties as collections, maybe extend this to (gasp) xml. \nTake a look at serialization properties in c# for more.\n\n# Todo", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://packages.python.org/jsonprop", "keywords": "json serialization", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "jsonprop", "package_url": "https://pypi.org/project/jsonprop/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jsonprop/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://packages.python.org/jsonprop" }, "release_url": "https://pypi.org/project/jsonprop/0.0.5/", "requires_dist": null, "requires_python": null, "summary": "A json serialization library for python.", "version": "0.0.5" }, "last_serial": 848133, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ee9455d802eb02f30c1e62afe346de2e", "sha256": "87d0dd56dd5072986564cc31fb7af9de04e03771a6b14d9caa17df849c8c7a4b" }, "downloads": -1, "filename": "jsonprop-0.0.1.zip", "has_sig": false, "md5_digest": "ee9455d802eb02f30c1e62afe346de2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5163, "upload_time": "2013-08-17T07:56:46", "url": "https://files.pythonhosted.org/packages/bf/4a/3db7460f3c880b86fddcd7d4597d347d025328d04079cd6c057ba8dae67a/jsonprop-0.0.1.zip" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "bef0d7ea498ee12e9f492132cc5fa8cd", "sha256": "afb5b3042dc0242a7111da1a3158a55c92a6691e32a0b6e7601f6d6dadbb2b03" }, "downloads": -1, "filename": "jsonprop-0.0.2.zip", "has_sig": false, "md5_digest": "bef0d7ea498ee12e9f492132cc5fa8cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6016, "upload_time": "2013-08-17T08:06:52", "url": "https://files.pythonhosted.org/packages/b6/6e/057b534f939571eff52536f10f8b4963923fbdc66d919f3299f66d989bac/jsonprop-0.0.2.zip" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "a9fe271b64d9b497f634e99d867ef640", "sha256": "a777ce270a2bd5129ebd0b1efd637f2363d6c97ab02345e8b77dcf32cf91086f" }, "downloads": -1, "filename": "jsonprop-0.0.3.zip", "has_sig": false, "md5_digest": "a9fe271b64d9b497f634e99d867ef640", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7281, "upload_time": "2013-08-19T06:42:15", "url": "https://files.pythonhosted.org/packages/de/61/757ea439242be8c0fbd93b589df9d8caa0d5cb9eb459ae8e505e6d246128/jsonprop-0.0.3.zip" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "209eadfa21541e6c0e2d81a5c2341f4f", "sha256": "0c6481c9a98d4a43c4705233af13dd4887098f3e325d19b0729646c83f724b40" }, "downloads": -1, "filename": "jsonprop-0.0.4.zip", "has_sig": false, "md5_digest": "209eadfa21541e6c0e2d81a5c2341f4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7295, "upload_time": "2013-08-20T07:12:17", "url": "https://files.pythonhosted.org/packages/62/01/42f2376d4a2e031bcc743494dfeb0b8daf49decbdbf1bd5450b47885053c/jsonprop-0.0.4.zip" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "2b86ff1a2be312b39370c81c6b9875d9", "sha256": "16c54b0f7f3f74c2bbedbee49a8ba104602f7ec5479d7ee3d2076663e7336b17" }, "downloads": -1, "filename": "jsonprop-0.0.5.tar.gz", "has_sig": false, "md5_digest": "2b86ff1a2be312b39370c81c6b9875d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3445, "upload_time": "2013-08-25T00:50:49", "url": "https://files.pythonhosted.org/packages/25/37/ba807c9e6d485dcc201526f4fce3b2a461eff8751e7c3f408c5e00ef91a2/jsonprop-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2b86ff1a2be312b39370c81c6b9875d9", "sha256": "16c54b0f7f3f74c2bbedbee49a8ba104602f7ec5479d7ee3d2076663e7336b17" }, "downloads": -1, "filename": "jsonprop-0.0.5.tar.gz", "has_sig": false, "md5_digest": "2b86ff1a2be312b39370c81c6b9875d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3445, "upload_time": "2013-08-25T00:50:49", "url": "https://files.pythonhosted.org/packages/25/37/ba807c9e6d485dcc201526f4fce3b2a461eff8751e7c3f408c5e00ef91a2/jsonprop-0.0.5.tar.gz" } ] }