{ "info": { "author": "Jo\u00e3o Abecasis", "author_email": "joao@abecasis.name", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "# python-jref\n\nThis python package implements the JSON Reference and JSON Pointer\nspecifications in the context of processing JSON and YAML content, such as\nSwagger and OpenAPI specifications.\n\n## JSON Reference\n\nJSON Reference defines a mechanism to reference and include content from the\nsame or separate documents. This helps with maintenance of structured data and\ndocuments by reducing repetition, and allowing for the organization of larger\ndocuments across multiple files.\n\n## JSON Pointer\n\nJSON Pointer defines a syntax for identifying specific portions of a JSON\nvalue.\n\nIn a document, a JSON Reference takes the form of an object, mapping '$ref' to a\nreference; other keys in the object are ignored. The reference itself takes the\nform of a URI. As an example:\n\n { \"$ref\": \"http://example.com/example.json#/foo/bar\" }\n\nIn this implementation, the URI may reference a JSON or YAML file available in\nthe local filesystem, or served from the network over HTTP/HTTPS. The fragment\nportion of the URI is interpreted as a JSON Pointer.\n\n## Usage example\n\nFind the example below also as [`usage-example.py`](usage-example.py) in the\nsource repository.\n\n```python\nimport os\nimport textwrap\n\nimport jref.context\nimport jref.pointer\n\n# All references are evaluated in a context, so start with one\nctx = jref.context.RemoteContext()\n\n# Reference a remote document\nspec = ctx.parse_reference('https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml')\n\n# Reference portions of that document\nspec_title = spec.context.parse_reference('#/info/title')\nspec_version = spec.context.parse_reference('#/info/version')\n\n# Print out the references, not the content (which hasn't been loaded)\nprint(textwrap.dedent('''\n * JSON References\n Spec: {}\n Title: {}\n Version: {}\n ''')\n .lstrip()\n .format(spec, spec_title, spec_version))\n\n# Expand references, triggering loading of content\nprint(textwrap.dedent('''\n * Evaluated references\n Title: {}\n Version: {}\n ''')\n .lstrip()\n .format(spec_title.expand(), spec_version.expand()))\n```\n\nExpected output:\n\n```\n* JSON References\nSpec: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml\nTitle: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml#/info/title\nVersion: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml#/info/version\n\n* Evaluated references\nTitle: Swagger Petstore\nVersion: 1.0.0\n\n```\n\n## References\n\n* JSON Reference, Internet Draft,\n https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03\n* JSON Pointer, RFC 6901, https://tools.ietf.org/html/rfc6901\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/biochimia/python-jref", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "jref", "package_url": "https://pypi.org/project/jref/", "platform": "", "project_url": "https://pypi.org/project/jref/", "project_urls": { "Homepage": "https://github.com/biochimia/python-jref" }, "release_url": "https://pypi.org/project/jref/0.2.0/", "requires_dist": [ "pyyaml (==3.13)", "requests (==2.20.0)" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*", "summary": "JSON Reference and JSON Pointer implementations", "version": "0.2.0" }, "last_serial": 4493574, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "ab36e0e934dafb2dde50eaea259953d6", "sha256": "8d142ec1f7e737905c98481a16dabfd473328411941a9dcc0d86b2a94e0459c7" }, "downloads": -1, "filename": "jref-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ab36e0e934dafb2dde50eaea259953d6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*", "size": 22722, "upload_time": "2018-11-14T14:02:10", "url": "https://files.pythonhosted.org/packages/ab/3e/df2ea9cb9c2bc98fab3ef8802b67eb94c92b2faeff84a7fa042f43c424d7/jref-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4476598a912ace71f457306f4f37e0ee", "sha256": "bca18ba8e51b84cb224fbd35cc3de657da72f7f958087d7491223def1d640687" }, "downloads": -1, "filename": "jref-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4476598a912ace71f457306f4f37e0ee", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*", "size": 14444, "upload_time": "2018-11-14T14:02:12", "url": "https://files.pythonhosted.org/packages/b3/bd/c6ae3e01a4c128b0a9ac1a261ddc1baea434cd44bceadb42bf1f77189630/jref-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5b966bab71e5f6fc8a292f686cc893aa", "sha256": "4f79fc2315e8136457c78f862c23bc83aa203f99c54fa08116ba4b41b3d86e01" }, "downloads": -1, "filename": "jref-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5b966bab71e5f6fc8a292f686cc893aa", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*", "size": 22987, "upload_time": "2018-11-15T12:21:24", "url": "https://files.pythonhosted.org/packages/03/ef/ebfaa253d4a84daa493717075048a5124942fa5c5c07c10d76d441a14b77/jref-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "92aaed0246295dfff05e767afcf4c6f1", "sha256": "0c1a511c267129d99d3b6d423c3aefbc7e4e8d5dc9616fdbfaa46f513d2055b5" }, "downloads": -1, "filename": "jref-0.1.1.tar.gz", "has_sig": false, "md5_digest": "92aaed0246295dfff05e767afcf4c6f1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*", "size": 14519, "upload_time": "2018-11-15T12:21:26", "url": "https://files.pythonhosted.org/packages/a9/fd/536d4aedfd8a8e57e7bd1782d5437f1a8f1148f489b2b194206680cebca6/jref-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "869f2a60fb8f2b50bdd8d4ef7c89eb81", "sha256": "a019bf3a863c16a5e4e939180f72186611bab333a88cb08a64a6e2978edfd8b6" }, "downloads": -1, "filename": "jref-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "869f2a60fb8f2b50bdd8d4ef7c89eb81", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*", "size": 22956, "upload_time": "2018-11-16T12:46:13", "url": "https://files.pythonhosted.org/packages/d3/ba/5b6729bf4b28b3fcd732d1f59ff2de65ef395e1d0560c23faf3cb95186dd/jref-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bebd000802ac069acb73182992856603", "sha256": "8ce777c52b4a27ed3ebba73a2f36278d2f31f16659d8e008c84158600fd9e8cf" }, "downloads": -1, "filename": "jref-0.2.0.tar.gz", "has_sig": false, "md5_digest": "bebd000802ac069acb73182992856603", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*", "size": 14510, "upload_time": "2018-11-16T12:46:14", "url": "https://files.pythonhosted.org/packages/ff/6e/5b2f8a4cb3072eef3fbf628564e8ad03cbae093af4b7bd122c5953bc5a3b/jref-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "869f2a60fb8f2b50bdd8d4ef7c89eb81", "sha256": "a019bf3a863c16a5e4e939180f72186611bab333a88cb08a64a6e2978edfd8b6" }, "downloads": -1, "filename": "jref-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "869f2a60fb8f2b50bdd8d4ef7c89eb81", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*", "size": 22956, "upload_time": "2018-11-16T12:46:13", "url": "https://files.pythonhosted.org/packages/d3/ba/5b6729bf4b28b3fcd732d1f59ff2de65ef395e1d0560c23faf3cb95186dd/jref-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bebd000802ac069acb73182992856603", "sha256": "8ce777c52b4a27ed3ebba73a2f36278d2f31f16659d8e008c84158600fd9e8cf" }, "downloads": -1, "filename": "jref-0.2.0.tar.gz", "has_sig": false, "md5_digest": "bebd000802ac069acb73182992856603", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*", "size": 14510, "upload_time": "2018-11-16T12:46:14", "url": "https://files.pythonhosted.org/packages/ff/6e/5b2f8a4cb3072eef3fbf628564e8ad03cbae093af4b7bd122c5953bc5a3b/jref-0.2.0.tar.gz" } ] }