{ "info": { "author": "Jamie Lennox", "author_email": "jamielennox@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "License :: OSI Approved :: Apache Software 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" ], "description": "===============================\njsonhome\n===============================\n\nHelpers for handling jsonhome documents\n\n* Free software: Apache license\n* Documentation: https://readthedocs.org/projects/jsonhome\n* Source: https://github.com/jamielennox/jsonhome\n* Bugs: http://bugs.launchpad.net/python-jsonhome\n\nIntroduction\n------------\n\nThe jsonhome library provides a simple way to build and consume compliant json-home documents.\n\nBuilding\n--------\n\nTo build a jsonhome document you create a document and then add resources::\n\n >>> import jsonhome\n\n >>> doc = jsonhome.Document()\n\n >>> doc.add_resource('http://mysite.com/rel/widgets',\n ... uri='/widgets{/widget_id}'\n ... uri_vars={'widget_id': 'http://mysite.com/param/widget'},\n ... allow_get=True,\n ... accept_post=['application/json'])\n\n >>> print(doc.to_json())\n {\n \"resources\": {\n \"http://mysite.com/rel/widgets\": {\n \"href-template\": \"/widgets{/widget_id}\",\n \"href-vars\": {\n \"widget_id\": \"http://mysite.com/param/widget\"\n },\n \"hints\": {\n \"accept-post\": [\n \"application/json\"\n ],\n \"allow\": [\n \"GET\",\n \"POST\"\n ]\n }\n }\n }\n }\n\nAdditional parameters to creating resources can be found on the module documentation.\n\nConsuming\n---------\n\nTo consume a json-home document you load it and then fetch the URIs you need::\n\n >>> doc = jsonhome.Document.from_json(data)\n\n >>> print(doc.get_uri('http://mysite.com/rel/widgets', widget_id='1234')\n '/widgets/1234'\n\nOr for specific information you can find helpers on the resource::\n\n >>> print(doc['http://mysite.com/rel/widgets'].href_vars)\n {\"widget_id\": \"http://mysite.com/param/widget\"}", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.jamielennox.net", "keywords": null, "license": null, "maintainer": null, "maintainer_email": null, "name": "jsonhome", "package_url": "https://pypi.org/project/jsonhome/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jsonhome/", "project_urls": { "Homepage": "http://www.jamielennox.net" }, "release_url": "https://pypi.org/project/jsonhome/0.1.0/", "requires_dist": [ "uritemplate.py" ], "requires_python": null, "summary": "Helpers for handling jsonhome documents", "version": "0.1.0" }, "last_serial": 1648982, "releases": { "0.0.0.post8": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "f698d0ec8ec93a8c14a1f0c350216457", "sha256": "36201a336ad96f6f07c44fb375c327176d8e0e2b5d35be145ba3c83cd564b9c5" }, "downloads": -1, "filename": "jsonhome-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f698d0ec8ec93a8c14a1f0c350216457", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12891, "upload_time": "2015-07-25T03:10:01", "url": "https://files.pythonhosted.org/packages/1f/08/737cc043fbd4b7e6d212474deb374edc80b0f60bd9ff343cc24dcfa02e27/jsonhome-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7930c61dea85e8ca89045ccf5f65951d", "sha256": "d0c2e04fd77a176acb7587b49a6275f75bee73d44f717690f39f2aa57f29f015" }, "downloads": -1, "filename": "jsonhome-0.1.0.tar.gz", "has_sig": false, "md5_digest": "7930c61dea85e8ca89045ccf5f65951d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15705, "upload_time": "2015-07-25T03:10:05", "url": "https://files.pythonhosted.org/packages/5a/3a/76ba53800e514a9867df415460b38ef4b3f7ea7769f811fdcaa07d3c2faa/jsonhome-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f698d0ec8ec93a8c14a1f0c350216457", "sha256": "36201a336ad96f6f07c44fb375c327176d8e0e2b5d35be145ba3c83cd564b9c5" }, "downloads": -1, "filename": "jsonhome-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f698d0ec8ec93a8c14a1f0c350216457", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12891, "upload_time": "2015-07-25T03:10:01", "url": "https://files.pythonhosted.org/packages/1f/08/737cc043fbd4b7e6d212474deb374edc80b0f60bd9ff343cc24dcfa02e27/jsonhome-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7930c61dea85e8ca89045ccf5f65951d", "sha256": "d0c2e04fd77a176acb7587b49a6275f75bee73d44f717690f39f2aa57f29f015" }, "downloads": -1, "filename": "jsonhome-0.1.0.tar.gz", "has_sig": false, "md5_digest": "7930c61dea85e8ca89045ccf5f65951d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15705, "upload_time": "2015-07-25T03:10:05", "url": "https://files.pythonhosted.org/packages/5a/3a/76ba53800e514a9867df415460b38ef4b3f7ea7769f811fdcaa07d3c2faa/jsonhome-0.1.0.tar.gz" } ] }