{ "info": { "author": "Chase Sterling", "author_email": "chase.sterling@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "jsonref\n=======\n\n.. image:: https://travis-ci.org/gazpachoking/jsonref.png?branch=master\n :target: https://travis-ci.org/gazpachoking/jsonref\n\n.. image:: https://coveralls.io/repos/gazpachoking/jsonref/badge.png?branch=master\n :target: https://coveralls.io/r/gazpachoking/jsonref\n\n\n``jsonref`` is a library for automatic dereferencing of\n`JSON Reference `_\nobjects for Python (supporting 2.6+ including Python 3).\n\nThis library lets you use a data structure with JSON reference objects, as if\nthe references had been replaced with the referent data.\n\n\n.. code-block:: python\n\n >>> from pprint import pprint\n >>> import jsonref\n\n >>> # An example json document\n >>> json_str = \"\"\"{\"real\": [1, 2, 3, 4], \"ref\": {\"$ref\": \"#/real\"}}\"\"\"\n >>> data = jsonref.loads(json_str)\n >>> pprint(data) # Reference is not evaluated until here\n {'real': [1, 2, 3, 4], 'ref': [1, 2, 3, 4]}\n\n\nFeatures\n--------\n\n* References are evaluated lazily. Nothing is dereferenced until it is used.\n\n* Recursive references are supported, and create recursive python data\n structures.\n\n\nReferences objects are actually replaced by lazy lookup proxy objects which are\nalmost completely transparent.\n\n.. code-block:: python\n\n >>> data = jsonref.loads('{\"real\": [1, 2, 3, 4], \"ref\": {\"$ref\": \"#/real\"}}')\n >>> # You can tell it is a proxy by using the type function\n >>> type(data[\"real\"]), type(data[\"ref\"])\n (, )\n >>> # You have direct access to the referent data with the __subject__\n >>> # attribute\n >>> type(data[\"ref\"].__subject__)\n \n >>> # If you need to get at the reference object\n >>> data[\"ref\"].__reference__\n {'$ref': '#/real'}\n >>> # Other than that you can use the proxy just like the underlying object\n >>> ref = data[\"ref\"]\n >>> isinstance(ref, list)\n True\n >>> data[\"real\"] == ref\n True\n >>> ref.append(5)\n >>> del ref[0]\n >>> # Actions on the reference affect the real data (if it is mutable)\n >>> pprint(data)\n {'real': [2, 3, 4, 5], 'ref': [2, 3, 4, 5]}\n\n\n.. image:: https://d2weczhvl823v0.cloudfront.net/gazpachoking/jsonref/trend.png\n :alt: Bitdeli badge\n :target: https://bitdeli.com/free", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/gazpachoking/jsonref", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "jsonref-ap", "package_url": "https://pypi.org/project/jsonref-ap/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jsonref-ap/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/gazpachoking/jsonref" }, "release_url": "https://pypi.org/project/jsonref-ap/0.3-dev/", "requires_dist": null, "requires_python": null, "summary": "An implementation of JSON Reference for Python", "version": "0.3-dev" }, "last_serial": 2035362, "releases": { "0.3-dev": [ { "comment_text": "", "digests": { "md5": "51b25675917222f986380655fe94dc03", "sha256": "c53acf383d2a56f8f92682db860bce4706cb14f679d6761126d536896eaff4dc" }, "downloads": -1, "filename": "jsonref-ap-0.3-dev.tar.gz", "has_sig": false, "md5_digest": "51b25675917222f986380655fe94dc03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12416, "upload_time": "2016-03-30T05:48:32", "url": "https://files.pythonhosted.org/packages/c2/31/09babfa03c4a548f31046d9e57617cffaaef5620aeb242af252d19ae4b28/jsonref-ap-0.3-dev.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "51b25675917222f986380655fe94dc03", "sha256": "c53acf383d2a56f8f92682db860bce4706cb14f679d6761126d536896eaff4dc" }, "downloads": -1, "filename": "jsonref-ap-0.3-dev.tar.gz", "has_sig": false, "md5_digest": "51b25675917222f986380655fe94dc03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12416, "upload_time": "2016-03-30T05:48:32", "url": "https://files.pythonhosted.org/packages/c2/31/09babfa03c4a548f31046d9e57617cffaaef5620aeb242af252d19ae4b28/jsonref-ap-0.3-dev.tar.gz" } ] }