{ "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.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "jsonref\n=======\n\n\n.. image:: https://readthedocs.org/projects/jsonref/badge/?version=latest\n :target: https://jsonref.readthedocs.io/en/latest/\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 Python 2.6+ and Python 3.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", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gazpachoking/jsonref", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "jsonref", "package_url": "https://pypi.org/project/jsonref/", "platform": "", "project_url": "https://pypi.org/project/jsonref/", "project_urls": { "Homepage": "https://github.com/gazpachoking/jsonref" }, "release_url": "https://pypi.org/project/jsonref/0.2/", "requires_dist": null, "requires_python": "", "summary": "An implementation of JSON Reference for Python", "version": "0.2" }, "last_serial": 4349904, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a7f511bd8d4b7b696b230aee7fa3c62b", "sha256": "56e0ce228798bdecadff865c142741b1ffdd57a5e9c40c40ec2b641d7c430ad3" }, "downloads": -1, "filename": "jsonref-0.1.tar.gz", "has_sig": false, "md5_digest": "a7f511bd8d4b7b696b230aee7fa3c62b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12296, "upload_time": "2013-05-17T21:25:08", "url": "https://files.pythonhosted.org/packages/3a/fe/42aca2f2a2e668375a92fcf74e0977a4943ca508e171c9a311b7d5fb9b07/jsonref-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "a422046ec61ba88d2ffb281f0d730536", "sha256": "b1e82fa0b62e2c2796a13e5401fe51790b248f6d9bf9d7212a3e31a3501b291f" }, "downloads": -1, "filename": "jsonref-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a422046ec61ba88d2ffb281f0d730536", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9346, "upload_time": "2018-10-07T19:24:08", "url": "https://files.pythonhosted.org/packages/07/92/f8e4ac824b14af77e613984e480fa818397c72d4141fc466decb26752749/jsonref-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "42b518b9ccd6852d1d709749bc96cb70", "sha256": "f3c45b121cf6257eafabdc3a8008763aed1cd7da06dbabc59a9e4d2a5e4e6697" }, "downloads": -1, "filename": "jsonref-0.2.tar.gz", "has_sig": false, "md5_digest": "42b518b9ccd6852d1d709749bc96cb70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13032, "upload_time": "2018-10-07T19:24:09", "url": "https://files.pythonhosted.org/packages/b3/cf/93d4f34d76863d4fb995cb8e3e4f29908304065ce6381e0349700c44ad0c/jsonref-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a422046ec61ba88d2ffb281f0d730536", "sha256": "b1e82fa0b62e2c2796a13e5401fe51790b248f6d9bf9d7212a3e31a3501b291f" }, "downloads": -1, "filename": "jsonref-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a422046ec61ba88d2ffb281f0d730536", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9346, "upload_time": "2018-10-07T19:24:08", "url": "https://files.pythonhosted.org/packages/07/92/f8e4ac824b14af77e613984e480fa818397c72d4141fc466decb26752749/jsonref-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "42b518b9ccd6852d1d709749bc96cb70", "sha256": "f3c45b121cf6257eafabdc3a8008763aed1cd7da06dbabc59a9e4d2a5e4e6697" }, "downloads": -1, "filename": "jsonref-0.2.tar.gz", "has_sig": false, "md5_digest": "42b518b9ccd6852d1d709749bc96cb70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13032, "upload_time": "2018-10-07T19:24:09", "url": "https://files.pythonhosted.org/packages/b3/cf/93d4f34d76863d4fb995cb8e3e4f29908304065ce6381e0349700c44ad0c/jsonref-0.2.tar.gz" } ] }