{ "info": { "author": "Nicolas Bessi", "author_email": "nbessi@gmail.com", "bugtrack_url": null, "classifiers": [], "description": ".. image:: https://travis-ci.org/nbessi/pyhiccup.svg?branch=master\n :target: https://travis-ci.org/nbessi/pyhiccup\n\n.. image:: https://coveralls.io/repos/nbessi/pyhiccup/badge.png?branch=master\n :target: https://coveralls.io/r/nbessi/pyhiccup?branch=master\n\npyhiccup 0.1\n============\n\nPython version of clojure hiccup https://github.com/weavejester/hiccup\nOriginal concept by James Reeves\n\nPyhiccup is a library for representing HTML in Python. It uses list or tuple\nto represent elements, and dict to represent an element's attributes.\nSupported Python versions are:\n\n- 2.6\n- 2.7\n- 3.3\n- 3.4\n\nInstall\n-------\n::\n\n pip install pyhiccup\n\nSyntax\n------\n\nHere is a basic example of pyhiccup syntax.\n\n.. code-block:: python\n\n\n >>> from pyhiccup.core import html\n >>> data = [\n >>> ['div',\n >>> {'class': 'a-class', 'data-y': '23'},\n >>> ['span', 'my-text',\n >>> ['ul', [['li', x] for x in ['caf\u00e9', 'milk', 'sugar']]]]]\n >>> ]\n >>> html(data)\n u'
my-text
'\n\n\nThe `html` function supports different default type `html5, html4, xhtml-strict, xhtml-transitional`\n\n.. code-block:: python\n\n\n >>> from pyhiccup.core import html\n >>> data = []\n >>> html(data, etype='xhtml-strict')\n >>> u''\n\nYou can pass arbitrary keyword arguments to the `html` they will be transformed into `html` tag attributes\n\n.. code-block:: python\n\n\n >>> from pyhiccup.core import html\n >>> data = []\n >>> html(data, etype='xhtml-strict', an-attr='foo')\n u'... '\n\nPyhiccup also provides a function to represent XML. Arbitrary keyword arguments are also supported.\n\n.. code-block:: python\n\n\n >>> from pyhiccup.core import xml\n >>> data = ['form-desc',\n >>> ['field', {'name': 'a_name'}],\n >>> ['field', {'name': 'a_other_name'}]]\n >>> conv = xml(data, 'foo-ns', bar='an_attr')\n u''\n\n\nSome time you want to be able to create XML/HTML chunk out of a namespace. The `core.convert` is made for this.\n\n.. code-block:: python\n\n\n >>> from pyhiccup.core import convert\n >>> from pyhiccup.element import link_to\n >>> convert(link_to('http://github.com/nbessi/pyhiccup', 'pyhiccup'))\n u'pyhiccup'\n\n\nHelpers are available on the elements namespace. The will help you to add hyperlink, images etc.\n\n.. code-block:: python\n\n\n >>> from pyhiccup.element import link_to\n >>> link_to(u'https://github.com/nbessi/pyhiccup', u'pyhiccup' )\n [u'a', {u'href': u'https://github.com/nbessi/pyhiccup'}, u'pyhiccup']", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/pyhiccup", "keywords": null, "license": "GPL3", "maintainer": null, "maintainer_email": null, "name": "pyhiccup", "package_url": "https://pypi.org/project/pyhiccup/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyhiccup/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/pyhiccup" }, "release_url": "https://pypi.org/project/pyhiccup/0.1/", "requires_dist": null, "requires_python": null, "summary": "Library for representing HTML in Python", "version": "0.1" }, "last_serial": 1291893, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "b22e71bbd1b0c6ba5d36ed2711d8611a", "sha256": "c4a54feed957f474b68928022ec0a32cb7d0e345a597b45c21efef1f81f7e39a" }, "downloads": -1, "filename": "pyhiccup-0.1.tar.gz", "has_sig": false, "md5_digest": "b22e71bbd1b0c6ba5d36ed2711d8611a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20370, "upload_time": "2014-11-02T16:23:32", "url": "https://files.pythonhosted.org/packages/31/ec/1b6fbf6cb4bec4e0ef33da0c5448eeb5d3c383983c84468cfbc27fe1aa18/pyhiccup-0.1.tar.gz" } ], "0.1.b": [ { "comment_text": "", "digests": { "md5": "f74a04262258213c26097ee300778fd6", "sha256": "b0ee8ed33a6011b0706bcc1641fd1c38e7b4bd0555a3cba7eeaf4cc7aa5b2f14" }, "downloads": -1, "filename": "pyhiccup-0.1.b.tar.gz", "has_sig": false, "md5_digest": "f74a04262258213c26097ee300778fd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20228, "upload_time": "2014-10-09T21:35:11", "url": "https://files.pythonhosted.org/packages/1f/cb/ee5cf0deb42bb2e1f0b527106dece8a14b42ac192b28042d4bcdf4047bb9/pyhiccup-0.1.b.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b22e71bbd1b0c6ba5d36ed2711d8611a", "sha256": "c4a54feed957f474b68928022ec0a32cb7d0e345a597b45c21efef1f81f7e39a" }, "downloads": -1, "filename": "pyhiccup-0.1.tar.gz", "has_sig": false, "md5_digest": "b22e71bbd1b0c6ba5d36ed2711d8611a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20370, "upload_time": "2014-11-02T16:23:32", "url": "https://files.pythonhosted.org/packages/31/ec/1b6fbf6cb4bec4e0ef33da0c5448eeb5d3c383983c84468cfbc27fe1aa18/pyhiccup-0.1.tar.gz" } ] }