{ "info": { "author": "Kevin L. Mitchell", "author_email": "kevin.mitchell@rackspace.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "======================\n``URLTree`` URL Router\n======================\n\nThis package provides a tree-oriented URL router. Most URL routers\noperate by matching a URL against a list of regular expressions until\nthey find one that matches, but this has obvious performance penalties\nif there are many routes. ``URLTree`` is different; routes are stored\nas a tree, and matching a URL against the set of routes is equivalent\nto traversing the tree.\n\nThe ``URLTree`` router supports parameters, and even allows parameter\nvalues to be matched against regular expressions or converted by\nfunctions. Moreover, as long as these \"restrictions\" and the variable\nnames are different, several of these parameters can be declared at\nthe same level of a URL tree; this allows a URL with, say, an integer\nin one location to be mapped to one destination, while a second URL\nwith non-integer values in that same location may be mapped to another\ndestination.\n\nTo use ``URLTree``, allocate a ``URLTree`` object and use the\n``URLTree.route()`` method to map a URL pattern to a destination, like\nso::\n\n mapper = URLTree()\n mapper.route(\"/article\", list_articles, \"get\")\n mapper.route(\"/article\", create_article, \"post\")\n mapper.route(\"/article/{id}\", get_article, \"get\", id=int)\n mapper.route(\"/article/{id}\", update_article, \"put\", id=int)\n mapper.route(\"/article/{id}\", delete_article, \"delete\", id=int)\n\nUpon receiving a request, the destination and the parameters can be\nretrieved using the ``URLTree.resolve()`` method, like so::\n\n # \"req.method\" is the HTTP method, and \"req.url\" is the requested\n # URL\n dest, params = mapper.resolve(req.method, req.url)\n\nNote that ``URLTree`` does not interpret the destination; the examples\nabove use callables, but anything can be used here.", "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/klmitch/urltree", "keywords": null, "license": "Apache License (2.0)", "maintainer": null, "maintainer_email": null, "name": "urltree", "package_url": "https://pypi.org/project/urltree/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/urltree/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/klmitch/urltree" }, "release_url": "https://pypi.org/project/urltree/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "URLTree URL Router", "version": "0.1.0" }, "last_serial": 801288, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b6e4741526fa865d631d72b2ef4547f7", "sha256": "6f04873334e17c5a285d3f41c6add977edc76d38993606f8a398a57617371354" }, "downloads": -1, "filename": "urltree-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b6e4741526fa865d631d72b2ef4547f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13286, "upload_time": "2013-04-25T01:11:59", "url": "https://files.pythonhosted.org/packages/43/09/4c0f4e55adf54b7dbaab47a7a8e8972566dcc8659f75c5ac90205b2055f0/urltree-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b6e4741526fa865d631d72b2ef4547f7", "sha256": "6f04873334e17c5a285d3f41c6add977edc76d38993606f8a398a57617371354" }, "downloads": -1, "filename": "urltree-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b6e4741526fa865d631d72b2ef4547f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13286, "upload_time": "2013-04-25T01:11:59", "url": "https://files.pythonhosted.org/packages/43/09/4c0f4e55adf54b7dbaab47a7a8e8972566dcc8659f75c5ac90205b2055f0/urltree-0.1.0.tar.gz" } ] }