{ "info": { "author": "Infrae", "author_email": "info@infrae.com", "bugtrack_url": null, "classifiers": [ "Framework :: Zope2", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "===========\ninfrae.rest\n===========\n\n``infrae.rest`` provide a simple way to write REST APIs in Zope 2.\n\nAPI\n===\n\nREST component\n--------------\n\n``infrae.rest`` provides mainly a base class ``REST`` which behave a\nlot like a Grok view::\n\n from infrae.rest import REST\n\n class MyAction(REST):\n \"\"\"My action REST API.\n \"\"\"\n\n def POST(self, name, value):\n # Called by POST /content/++rest++myaction&name=foo?value=bar\n return 'Success'\n\n def GET(self):\n # Called by GET /content/++rest++myaction\n values = self.context.something()\n return self.json_response(values)\n\n\nYou just have to grok your package to make it available.\n\n- You can provide: ``POST``, ``GET``, ``HEAD``, ``DELETE`` requests.\n\n- You can use the directives ``grok.name``, ``grok.require`` and\n ``grok.context`` to configure your REST API. They work exactly like\n on a ``grok.View``.\n\n- If you need, you can manually query a REST component with the help\n of ``infrae.rest.queryRESTComponent``.\n\n\nNesting REST component\n----------------------\n\nYou can nest REST component. In that you should use the grok directive\nadapts in order to define which is the parent handler, and the\ncontext::\n\n from infrae.rest import REST\n from five import grok\n from OFS.Folder import Folder\n\n class ParentHandler(REST):\n grok.context(Folder)\n\n def GET(self):\n # Called by GET /folder/++rest++parenthandler\n return u'Hello'\n\n\n class ChildHandler(REST):\n grok.adapts(ParentHandler, Folder)\n\n def GET(self):\n # Called by GET /folder/++rest++parenthandler/childhandler\n return u'Child\n\n\nRESTWithTemplate component\n--------------------------\n\nYou can alternatively use the base class ``RESTWithTemplate``. The\nonly difference is that your class will be associated to a Grok\ntemplate automatically.\n\n\nRepository\n==========\n\nSources can be found in Mercurial at: https://hg.infrae.com/infrae.rest\n\nChanges\n=======\n\n1.3 (2013-05-23)\n----------------\n\n* Add support for ``static`` on a ``RESTWithTemplate`` component.\n\n* Update tests.\n\n1.2 (2012-09-04)\n----------------\n\n* Change registry for handlers from ``zope.component`` to\n ``zeam.component``. This simplify the code base and brings more\n flexibility. Expose ``queryRESTComponent`` function.\n\n* Remove usage of Zope 2 ``shiftNameToApplication``, as this is buggy\n in recent Zope 2 releases.\n\n1.1 (2011-11-07)\n----------------\n\n* Add support for nested handlers.\n\n* Add support for ``absoluteURL``, in order to get back the URL of an handler.\n\n* Add a default component that is associated with a Grok template. You\n have to trigger the template rendering yourself.\n\n* An event is triggered when a handler is published. If the handlers\n are nested, the event is only triggered for the last one. You can\n see as publisher after traverse event, except you have access to the\n associated handler that is published.\n\n* We now use only the Python native json module (and no longer\n simplejson).\n\n1.0.1 (2010-10-07)\n------------------\n\n* Don't define response as a property to be compatible with other Zope views (as a mixin).\n\n1.0 (2010-07-15)\n----------------\n\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://infrae.com/products/silva", "keywords": "silva cms rest api zope", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "infrae.rest", "package_url": "https://pypi.org/project/infrae.rest/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/infrae.rest/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://infrae.com/products/silva" }, "release_url": "https://pypi.org/project/infrae.rest/1.3/", "requires_dist": null, "requires_python": null, "summary": "Define a REST API to access and manage Zope 2 content", "version": "1.3" }, "last_serial": 945366, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "7ecbe6dedb8dca0661062680992f6817", "sha256": "7771ad139d6b9abafeb9b968acda91031ec33c8c0919e40b16e1e7e5e5b44f58" }, "downloads": -1, "filename": "infrae.rest-1.0.tar.gz", "has_sig": false, "md5_digest": "7ecbe6dedb8dca0661062680992f6817", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5633, "upload_time": "2010-07-15T18:27:47", "url": "https://files.pythonhosted.org/packages/2b/1d/456b7f882301e007056634d600ce887baea958c0f0b433f2afe663e5d93d/infrae.rest-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "6c9b28310f71f36bfd17e98def8d17f7", "sha256": "af1145bab822cba26286ad431c189b74a1602f8ca26d0d4471b46e3c8c957b3b" }, "downloads": -1, "filename": "infrae.rest-1.0.1.tar.gz", "has_sig": false, "md5_digest": "6c9b28310f71f36bfd17e98def8d17f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5643, "upload_time": "2010-10-07T15:21:30", "url": "https://files.pythonhosted.org/packages/9e/40/23073c5c5b726cedd7b5828a225df033129fae426848099adfac309df57a/infrae.rest-1.0.1.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "1739d3f52a0091eb7dc9b6bf2df25ab1", "sha256": "65d04d6854155a0e2b1830e2c69d04b2e373ff7502f000afb15b968e2abd5170" }, "downloads": -1, "filename": "infrae.rest-1.1.tar.gz", "has_sig": false, "md5_digest": "1739d3f52a0091eb7dc9b6bf2df25ab1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8195, "upload_time": "2011-11-07T13:45:18", "url": "https://files.pythonhosted.org/packages/79/ff/32fb860e3afa84b6826a04dac5a7c542ed2fd89a6e8126b9329d2941ae09/infrae.rest-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "68d16388b0bdd45ec78785d99ca5bd77", "sha256": "013bcb0ca7ddf262f7d70a3caaafe984130f0a9538872b53c7b6c2c6b248388b" }, "downloads": -1, "filename": "infrae.rest-1.2.tar.gz", "has_sig": false, "md5_digest": "68d16388b0bdd45ec78785d99ca5bd77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9343, "upload_time": "2012-09-04T09:07:55", "url": "https://files.pythonhosted.org/packages/a9/91/cd0a74bfa94f6d905e4558f145a8c036f085764bb982c957382e369eb983/infrae.rest-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "831ee45ed271ffb8f624a8fe65d29777", "sha256": "ecf0d576836289b7a973e7f74ee03ab2effbf872bf94d4276110e1ef11279200" }, "downloads": -1, "filename": "infrae.rest-1.3.tar.gz", "has_sig": false, "md5_digest": "831ee45ed271ffb8f624a8fe65d29777", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9853, "upload_time": "2013-05-23T09:18:06", "url": "https://files.pythonhosted.org/packages/1b/27/336680d1783cb5ac0507acc2ba16e7d2486199a6cff42fc7787fe0add8de/infrae.rest-1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "831ee45ed271ffb8f624a8fe65d29777", "sha256": "ecf0d576836289b7a973e7f74ee03ab2effbf872bf94d4276110e1ef11279200" }, "downloads": -1, "filename": "infrae.rest-1.3.tar.gz", "has_sig": false, "md5_digest": "831ee45ed271ffb8f624a8fe65d29777", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9853, "upload_time": "2013-05-23T09:18:06", "url": "https://files.pythonhosted.org/packages/1b/27/336680d1783cb5ac0507acc2ba16e7d2486199a6cff42fc7787fe0add8de/infrae.rest-1.3.tar.gz" } ] }