{ "info": { "author": "Dan Cardin", "author_email": "ddcardin@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: Unix", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP :: WSGI" ], "description": "Tawdry\n======\n\n*Tawdry* is a Type Annotated Web framework which emphasizes Dont Repeat Yourself\n\nMore specifically, *Tawdry* is a \"*microframework*\" similar to *flask* or\nsomewhat less similar to Pyramid or Django. It tries to get out of your way\nby requiring the absolute minimal amount of boilerplate or extra code of any\nkind.\n\n*Tawdry* also aims to improve the clarity of the code you *do* write by\ncentralizing and localizing the information about your server and its routes.\n\nExample Application\n-------------------\n\n.. code-block:: python\n\n import tawdry\n\n def hello(request, publisher):\n return 'World!'\n\n app = tawdry.Tawdry({'hello': hello})\n\n if __name__ == '__main__':\n app.serve()\n\nOnce run, it will create a single route at `/hello`, on localhost by default.\n\n.. code-block:: bash\n\n $ curl localhost:5000/hello\n World!\n\nInstallation\n------------\n\n.. code-block:: python\n\n pip install tawdry\n\nRequires Python 3 (and you're best off with 3.5)\n\nType Annotations\n----------------\n\nThe above example doesn't really do much to show the purpose of *Tawdry* though.\nThe whole point here is to use type annotations, as they are the mechanism\nthrough which *Tawdry* does its stuff! So lets look at a slightly more complex\nexample.\n\n.. code-block:: python\n\n import tawdry\n\n def exclaim(request, exclamation: str) -> Response:\n return exclamation + '!'\n\n sitemap = {\n 'exclaim': {\n '{exclamation}': exclaim,\n },\n }\n app = tawdry.Tawdry(sitemap)\n\n if __name__ == '__main__':\n app.serve()\n\n.. code-block:: bash\n\n $ curl localhost:5000/exclaim/wahhoooo\n wahhoooo!\n\nOf note in the above example:\n\n* An argument type annotation will convert the argument to the annotated type\n before calling the function.\n\n* A return type, type annotation will convert the function's return value\n after it returns.\n\n* The `sitemap` is a dict given in the form where:\n\n + The values are the functions which will be called in the event of a match.\n\n + The keys match a url segment with the same string, so nested dictionaries\n result in matches to subsequent nested segments.\n\n + Any key enclosed in curly braces is given as a parameter to the function\n given as a value, as well as any parameters leading up to it.\n\nSo in the above example:\n\n1. the sitemap defines a single manifested route in the form\n `/exclaim/{paramerer}`.\n2. `parameter` will be converted (in this case unnecessarily) to a string before\n being passed to `exclaim`.\n3. The return value of `exclaim` will be converted to a `Response` object\n (*note* `Response` is applied by default, but other return types exist, such\n as `JsonResponse` and `XmlResponse`)\n4. The `Response` object is wsgi compatible and will return the result to\n the caller", "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/dancardin/tawdry", "keywords": null, "license": "Apache2", "maintainer": null, "maintainer_email": null, "name": "tawdry", "package_url": "https://pypi.org/project/tawdry/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tawdry/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/dancardin/tawdry" }, "release_url": "https://pypi.org/project/tawdry/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "Type Annotated Web framework emphasizing Dont Repeat Yourself", "version": "0.0.2" }, "last_serial": 2361993, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "488d09c554321c6478c81c4378e44b01", "sha256": "3c34f54b43484b08f71b8213e76f16742196bd0d1ca27d0099222aaf2d31f4e6" }, "downloads": -1, "filename": "tawdry-0.0.1.tar.gz", "has_sig": false, "md5_digest": "488d09c554321c6478c81c4378e44b01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6104, "upload_time": "2016-09-25T02:28:13", "url": "https://files.pythonhosted.org/packages/eb/46/c25d13823ae66949b9957e41a0518c909e49b3583267d516a90c7cbbdfdb/tawdry-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "81b67702f9d4182b1ac364a0d536ea6e", "sha256": "f3e60aa3a1f160d216f4bdaee65b29ff7c05d2e42a15defec404c5d9909dba57" }, "downloads": -1, "filename": "tawdry-0.0.2.tar.gz", "has_sig": false, "md5_digest": "81b67702f9d4182b1ac364a0d536ea6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6380, "upload_time": "2016-09-25T04:08:08", "url": "https://files.pythonhosted.org/packages/5b/65/172e44ed06e89ab241afcfd1e7a3496eb3c2f90c40ac0132bae56b8a0b3c/tawdry-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "81b67702f9d4182b1ac364a0d536ea6e", "sha256": "f3e60aa3a1f160d216f4bdaee65b29ff7c05d2e42a15defec404c5d9909dba57" }, "downloads": -1, "filename": "tawdry-0.0.2.tar.gz", "has_sig": false, "md5_digest": "81b67702f9d4182b1ac364a0d536ea6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6380, "upload_time": "2016-09-25T04:08:08", "url": "https://files.pythonhosted.org/packages/5b/65/172e44ed06e89ab241afcfd1e7a3496eb3c2f90c40ac0132bae56b8a0b3c/tawdry-0.0.2.tar.gz" } ] }