Writing XML with Pythonic code
==============================
.. image:: https://img.shields.io/github/license/mashape/apistatus.svg
:target: http://opensource.org/licenses/MIT
.. image:: https://badge.fury.io/py/pytohtml.svg
:target: https://badge.fury.io/py/pytohtml
Installation
------------
.. code:: bash
$ pip install pytohtml
Example
-------
.. image:: https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/597237/436215da-f815-4473-687e-7fc21b04bab3.gif
`QR-Code Generator Source Code <https://github.com/am230/py2html/blob/master/examples/qr%20generator.py>`_.
.. image:: https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/597237/40173212-8f2e-0e4e-c924-3140d6ff1722.gif
`Simple Chat Source Code <https://github.com/am230/py2html/blob/master/examples/form.py>`_.
Syntax
------
.. code:: python
from py2html.elements import html, head, body, meta, title, h1
print(
html(lang="en")[
head[
meta(charset="UTF-8"),
meta({"http-equiv": "X-UA-Compatible", "content": "IE=edge"}),
meta(name="viewport", content="width=device-width, initial-scale=1.0"),
title["py2html"]
],
body[
h1[
"Hello, Py2HTML!"
]
]
].render()
)
\*formatted output
.. code:: html
<html lang="en">
<head>
<meta charset="UTF-8"></meta>
<meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>
<meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
<title>py2html</title>
</head>
<body>
<h1>Hello, Py2HTML!</h1>
</body>
</html>
Raw data
{
"_id": null,
"home_page": "https://github.com/am230/py2html",
"name": "pytohtml",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "html,pythonic",
"author": "am230",
"author_email": "am.230@outlook.jp",
"download_url": "https://files.pythonhosted.org/packages/2c/07/946a4f014d8d4c5670778c4f0ebc39b5ce5e110bbb916d06ca58e05acbd3/pytohtml-1.2.5.tar.gz",
"platform": "any",
"description": "Writing XML with Pythonic code\n==============================\n\n.. image:: https://img.shields.io/github/license/mashape/apistatus.svg\n :target: http://opensource.org/licenses/MIT\n.. image:: https://badge.fury.io/py/pytohtml.svg\n :target: https://badge.fury.io/py/pytohtml\n\nInstallation\n------------\n\n.. code:: bash\n\n $ pip install pytohtml\n\nExample\n-------\n\n.. image:: https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/597237/436215da-f815-4473-687e-7fc21b04bab3.gif\n\n`QR-Code Generator Source Code <https://github.com/am230/py2html/blob/master/examples/qr%20generator.py>`_.\n\n.. image:: https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/597237/40173212-8f2e-0e4e-c924-3140d6ff1722.gif\n\n`Simple Chat Source Code <https://github.com/am230/py2html/blob/master/examples/form.py>`_.\n\nSyntax\n------\n\n.. code:: python\n\n from py2html.elements import html, head, body, meta, title, h1\n\n\n print(\n html(lang=\"en\")[\n head[\n meta(charset=\"UTF-8\"),\n meta({\"http-equiv\": \"X-UA-Compatible\", \"content\": \"IE=edge\"}),\n meta(name=\"viewport\", content=\"width=device-width, initial-scale=1.0\"),\n title[\"py2html\"]\n ],\n body[\n h1[\n \"Hello, Py2HTML!\"\n ]\n ]\n ].render()\n )\n \n\n\\*formatted output\n\n.. code:: html\n\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\"></meta>\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"></meta>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"></meta>\n <title>py2html</title>\n </head>\n <body>\n <h1>Hello, Py2HTML!</h1>\n </body>\n </html>\n\n",
"bugtrack_url": null,
"license": "MIT Licence",
"summary": "Write HTML with Pythonic Code",
"version": "1.2.5",
"split_keywords": [
"html",
"pythonic"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2c07946a4f014d8d4c5670778c4f0ebc39b5ce5e110bbb916d06ca58e05acbd3",
"md5": "949c84fd8c4f409b52b46fdfe8705a11",
"sha256": "2944a6cad10dbd48476acfe1d548e88413c9727edd7b66811adfb592240d682a"
},
"downloads": -1,
"filename": "pytohtml-1.2.5.tar.gz",
"has_sig": false,
"md5_digest": "949c84fd8c4f409b52b46fdfe8705a11",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 59048,
"upload_time": "2023-03-16T00:40:02",
"upload_time_iso_8601": "2023-03-16T00:40:02.874345Z",
"url": "https://files.pythonhosted.org/packages/2c/07/946a4f014d8d4c5670778c4f0ebc39b5ce5e110bbb916d06ca58e05acbd3/pytohtml-1.2.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-16 00:40:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "am230",
"github_project": "py2html",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "strbuilder",
"specs": []
},
{
"name": "Flask",
"specs": []
},
{
"name": "libsass",
"specs": []
},
{
"name": "py2js",
"specs": []
}
],
"lcname": "pytohtml"
}