{ "info": { "author": "Ben Soroos", "author_email": "ben@soroos.net", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Utilities" ], "description": "# PyMarkup\n[![Build Status](https://travis-ci.org/bluepython508/PyMarkup.svg?branch=master)](https://travis-ci.org/bluepython508/PyMarkup)\n[![Documentation Status](https://readthedocs.org/projects/pymarkup/badge/?version=latest)](https://pymarkup.readthedocs.io/en/latest/?badge=latest)\n\nAn internal DSL for generating XML-like markup in Python 3.7\n\n### Installation\nInstallation is as simple as `pip install pymarkup`.\nTo develop, download the source, and run `pip install -e .[dev]`\n\n### Usage\nA basic example:\n```python\nfrom pymarkup import MarkupBuilder\n\nt = MarkupBuilder()\n\nwith t: # tag\n with t.h1(id='HelloWorld'): # Attribute access creates new element, and call adds attributes to tag\n t + 'Hello World!' # Add child text to tag\n\n with t.a(href=\"github.com\"):\n t + t.img(src=\"i_am_an_image.png\") # Self-closing tags are added with +\n with t.ul:\n for x in range(2):\n with t.li:\n t + x\n```\n`repr(t)` gives:\n```html\n\n

\nHello World!\n

\n\n\n