{ "info": { "author": "Noah Seger", "author_email": "nosamanuel@gmail.com.com", "bugtrack_url": null, "classifiers": [], "description": "cottonmouth\n===========\n\nPure-Python HTML generation, inspired by [Hiccup][1].\n\n```python\nfrom cottonmouth.html import render\nfrom cottonmouth.tags import html, head, body, title, meta, link, h1\n\ndef welcome(user=None, **context):\n return ['p', 'Welcome' + (' back!' if user else '!')]\n\ncontent = (\n # Feel free to use raw HTML\n '',\n # Tags are represented as sequences with a tag name at the head\n [html,\n # Or just use strings instead of the default tag symbols\n ['head',\n [title, 'The Site'],\n # Attributes are passed as a dict immediately after the tag\n [meta, {'charset': 'utf-8'}],\n [link, dict(rel='stylesheet', type='text/css',\n href='static/layout.css')]],\n [body,\n # You can also call tags as functions with the content as\n # the first argument and attributes as `kwargs`\n [header, h1(u'The Website', id='header')],\n # Use \"#id.class\" shortcuts to easily create `div` elements\n ['#map.pretty-map'],\n # Functions will be called with context and the results rendered\n ['#main', welcome]]]\n)\n\nrender(*content, user=None)\n```\n\nEquivalent output:\n\n```html\n\n\n\n The Site\n \n \n\n\n

Welcome to the site!

\n
\n
\n

Welcome!

\n
\n\n\n```\n\n\n### Classes\n\nThere's a shortcut for dynamic classes: strings or iterables of classnames are automatically appended to the sugared classname!\n\n```python\nrender(['.foo', {'class': 'bar baz'}])\n# u'
'\n\nrender(['.foo', {'class': ['bar', 'baz']}])\n# u'
'\n```\n\n\n### Installation\n\n pip install cottonmouth\n\n\n### Testing\n\n python setup.py test\n\n\n### License\n\nBSD Copyright 2013, Noah Seger\n\n\n[1]: https://github.com/weavejester/hiccup\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nosamanuel/cottonmouth", "keywords": "", "license": "Copyright (c) 2013, Noah Seger", "maintainer": "", "maintainer_email": "", "name": "cottonmouth", "package_url": "https://pypi.org/project/cottonmouth/", "platform": null, "project_url": "https://pypi.org/project/cottonmouth/", "project_urls": { "Homepage": "https://github.com/nosamanuel/cottonmouth" }, "release_url": "https://pypi.org/project/cottonmouth/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "Pure-Python HTML generation", "version": "0.2.2" }, "last_serial": 2583621, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "15ae3b88e3215cbd0096682449993a1f", "sha256": "d2488c630cc050405940903e9a93bde380fab27e0b1684b7b3913f1983b59441" }, "downloads": -1, "filename": "cottonmouth-0.1.0.tar.gz", "has_sig": false, "md5_digest": "15ae3b88e3215cbd0096682449993a1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4076, "upload_time": "2013-07-10T20:22:51", "url": "https://files.pythonhosted.org/packages/26/49/3e6d52e863a070ea3ff761a297d0277fb02b000dd1b1dc5a243a2d2d78fd/cottonmouth-0.1.0.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "638dd7e2d84284f11df861734637c294", "sha256": "b6e2be28c4c53c7afbb8b828785d543dee602159d73edea6e6baa70bece1e09e" }, "downloads": -1, "filename": "cottonmouth-0.1.2.tar.gz", "has_sig": false, "md5_digest": "638dd7e2d84284f11df861734637c294", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4364, "upload_time": "2013-07-24T15:28:30", "url": "https://files.pythonhosted.org/packages/f7/02/8fd4d72bbbf5247d577c4efe533841dc48fca9d757edfc97562fa0452f8e/cottonmouth-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "24163d1c6f1128fb11ca16214cf06efc", "sha256": "38df7a38673b824ad803a8ad85596ea674c2a08b0d93396a217130340aab0a70" }, "downloads": -1, "filename": "cottonmouth-0.1.3.tar.gz", "has_sig": false, "md5_digest": "24163d1c6f1128fb11ca16214cf06efc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4365, "upload_time": "2013-07-24T15:31:06", "url": "https://files.pythonhosted.org/packages/8c/d5/40350de66083a9634b9af818d024a52069671fde6dbb8b02e04f03c36cab/cottonmouth-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "4cae8423e3d122c2f1384a548055641e", "sha256": "59a1a6d0e83580a637ba42f39673167b9049eac6e591ef410215599667b77a5f" }, "downloads": -1, "filename": "cottonmouth-0.2.0.tar.gz", "has_sig": false, "md5_digest": "4cae8423e3d122c2f1384a548055641e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4426, "upload_time": "2013-12-02T01:34:57", "url": "https://files.pythonhosted.org/packages/fa/2c/0d127afe849366fca7e537b08afe2e8ce60ad8b762993bc7556dcd78679f/cottonmouth-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "9a6743efeef858fa55360e138dfb08bc", "sha256": "7a9a2efbfe51bef96e87ba99a52f01579e02d6de25c0d57542ee9ada0b1b8ff7" }, "downloads": -1, "filename": "cottonmouth-0.2.1.tar.gz", "has_sig": false, "md5_digest": "9a6743efeef858fa55360e138dfb08bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4389, "upload_time": "2017-01-18T22:44:23", "url": "https://files.pythonhosted.org/packages/ce/20/b8ee29ad1cf6c985afbe33c5d80d2de164f8ad613d4801174b2fbbfc6841/cottonmouth-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "7bf1ee2d04ed3c34136ee885dd27a1ab", "sha256": "d3c5f30bf27b28870e05ba9078abb7aeb2ec0745c73ce3920dba20c11c49b424" }, "downloads": -1, "filename": "cottonmouth-0.2.2.tar.gz", "has_sig": false, "md5_digest": "7bf1ee2d04ed3c34136ee885dd27a1ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4620, "upload_time": "2017-01-18T22:47:48", "url": "https://files.pythonhosted.org/packages/86/b6/f32e288b52edac07ae9b0403a80275dc279638d2930ea64d2ba52a2f9673/cottonmouth-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7bf1ee2d04ed3c34136ee885dd27a1ab", "sha256": "d3c5f30bf27b28870e05ba9078abb7aeb2ec0745c73ce3920dba20c11c49b424" }, "downloads": -1, "filename": "cottonmouth-0.2.2.tar.gz", "has_sig": false, "md5_digest": "7bf1ee2d04ed3c34136ee885dd27a1ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4620, "upload_time": "2017-01-18T22:47:48", "url": "https://files.pythonhosted.org/packages/86/b6/f32e288b52edac07ae9b0403a80275dc279638d2930ea64d2ba52a2f9673/cottonmouth-0.2.2.tar.gz" } ] }