{ "info": { "author": "Joshua D. Boyd", "author_email": "jdboyd@jdboyd.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "![TravisCI Status](https://api.travis-ci.org/jd-boyd/corker.png)\n\n# About\n\nI wanted a framework that was based around\n[routes](https://github.com/bbangert/routes) and\n[webob](http://webob.org/) without opinionation about database and\ntemplating.\n\nSome of the specifics of this are inspired/copied from: http://www.ianbicking.org/blog/2010/03/12/a-webob-app-example/index.html\n\n# Installation\n\n `pip install corker`\n\n# Usage\n\nThe basics are that you create controllers (classes that subclass\n`BaseController`). In a controller, you label methods with the `@route`\ndecorator to expose them. You then invoke your controller's\n`setup_routes` method (inheritted from `BaseController`), passing it a\nroutes mapper to add itself to. Then, to create the actual wsgi app,\nyou create an `Application` and pass it the mapper.\n\nIn a controller, `self.request` gives you the current WebOb request\nobject. The controller can return a string containing HTML (in which\ncase it will be given a status code of 200), or a WebOb response object.\nAdditionally, it is safe to raise any\n[WebOb exception](http://webob.readthedocs.org/en/latest/modules/exceptions.html).\n\nOn an exposed method, the arguments (after self) are from routes\npositional/regex arguments. GET and POST arguments are accessed via\n`self.request`.\n\nThe arguments for the `@route` decorator largely match the arguments for\nroute's `mapper.connect` method. The decorated method is automatically\nused as the action argument to `mapper.connect` and all other arguments\nto `@route` are passed through to `mapper.connect` as is.\n\nArguments passed to `Application` after the mapper are inserted into\ncontrollers with the same name. So, is the `Application` was\ninstantiated with `Application(mapper, x=5)`, then in an exposed method\non the controller, `self.x == 5` would be `True`.\n\n## Example\n\n```python\nfrom routes import Mapper\n\nfrom corker.controller import BaseController, route\nfrom corker.app import Application\nfrom webob import Response\n\nclass Index(BaseController):\n @route('')\n def index(self, request):\n return 'Hi index!\\n'\n\n @route('view/{item}')\n def view(self, request, item):\n return 'Hi view %d!\\n' % int(item)\n\nclass Sub(BaseController):\n def __init__(self, request, arg1):\n self.request = request\n self.arg1 = arg1\n\n @route('')\n def index(self, request):\n return Response('Hi sub!\\n' + self.arg1)\n\nmapper = Mapper()\nIndex.setup_routes(mapper)\nwith mapper.submapper(path_prefix='/sub') as sub:\n Sub.setup_routes(sub, config={\"arg1\": \"arg string\"})\n\nexample_app = Application(mapper)\n\n# At that point `example_app` is a wsgi app ready to be mounted by the\n# server of your choice. For example with `wsgiref`:\n\nfrom wsgiref.util import setup_testing_defaults\nfrom wsgiref.simple_server import make_server\n\nhttpd = make_server('', 8000, example_app)\nprint \"Serving on port 8000...\"\nhttpd.serve_forever()\n```\n\n# Bugs/Feature Requests\n\nSee [github issues](https://github.com/jd-boyd/corker/issues).\n\n# Copyright\n This is distributed as BSD. Copyright Joshua D. Boyd\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jd-boyd/corker", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "corker", "package_url": "https://pypi.org/project/corker/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/corker/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jd-boyd/corker" }, "release_url": "https://pypi.org/project/corker/0.6.0/", "requires_dist": null, "requires_python": null, "summary": "Another WSGI Framework", "version": "0.6.0" }, "last_serial": 1740336, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "31333ed3be6c44c38701686e678eb0a3", "sha256": "28fd4bb6b911d8b8e644d56203ec280e6ab1000a369d9d8e788bed7fc94c9f44" }, "downloads": -1, "filename": "corker-0.3.tar.gz", "has_sig": false, "md5_digest": "31333ed3be6c44c38701686e678eb0a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2730, "upload_time": "2014-01-20T06:51:06", "url": "https://files.pythonhosted.org/packages/6b/64/9d3a039d5c8b20c610e968f5a83aaea004ad746f6ef91b9f0f25ed0caca7/corker-0.3.tar.gz" } ], "0.4": [], "0.4.1": [ { "comment_text": "", "digests": { "md5": "4e36cb24f8040527434606dde089715e", "sha256": "0ec2bc29eaa6ac88cd1bd098afcf6c7a50df39be2d0cc939b99eeb0eb9d0effb" }, "downloads": -1, "filename": "corker-0.4.1.tar.gz", "has_sig": false, "md5_digest": "4e36cb24f8040527434606dde089715e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5146, "upload_time": "2015-08-21T04:58:06", "url": "https://files.pythonhosted.org/packages/d6/0d/de1556b3a60358be86a988c406d4d6881f148f95a49ce94b1afed4cc1081/corker-0.4.1.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "788e1d7e66185e6c165db188d32a14cb", "sha256": "431f389b74305193331d702413e42d09fe08f5b28f817a5e031104f4d8ed6aa1" }, "downloads": -1, "filename": "corker-0.5.0-py2-none-any.whl", "has_sig": false, "md5_digest": "788e1d7e66185e6c165db188d32a14cb", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5369, "upload_time": "2015-08-25T06:32:42", "url": "https://files.pythonhosted.org/packages/12/e1/9d77868390d4c776da0e5493587c00465e6341407f648fb1b6545d67a1ae/corker-0.5.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b1f73492ac725a77903a115b14dfaec8", "sha256": "f5ca8c1ac760a8a7ea118b56e12ba73cb194b3597d2d4d4e574412658bdad6fb" }, "downloads": -1, "filename": "corker-0.5.0.tar.gz", "has_sig": false, "md5_digest": "b1f73492ac725a77903a115b14dfaec8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5390, "upload_time": "2015-08-25T06:32:37", "url": "https://files.pythonhosted.org/packages/f0/3b/907219bec4d3ef2e24759272512e26e773d5339694568b1f0859c693a315/corker-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "75afbb1cd8264a47a739f04d4e0122a2", "sha256": "d765611e8bd4501146089788ea962b9e0127239a0b6813ab598eeca3b349bec0" }, "downloads": -1, "filename": "corker-0.6.0.tar.gz", "has_sig": false, "md5_digest": "75afbb1cd8264a47a739f04d4e0122a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5876, "upload_time": "2015-09-27T05:12:21", "url": "https://files.pythonhosted.org/packages/5e/08/c6982ba510a7d4695d680760e552cc9d0c6112fb42bfe4bc807a8f70298b/corker-0.6.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "75afbb1cd8264a47a739f04d4e0122a2", "sha256": "d765611e8bd4501146089788ea962b9e0127239a0b6813ab598eeca3b349bec0" }, "downloads": -1, "filename": "corker-0.6.0.tar.gz", "has_sig": false, "md5_digest": "75afbb1cd8264a47a739f04d4e0122a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5876, "upload_time": "2015-09-27T05:12:21", "url": "https://files.pythonhosted.org/packages/5e/08/c6982ba510a7d4695d680760e552cc9d0c6112fb42bfe4bc807a8f70298b/corker-0.6.0.tar.gz" } ] }