tagic


Nametagic JSON
Version 1.0.4 PyPI version JSON
download
home_pagehttps://github.com/tammoippen/tagic
SummaryBuild html / xhtml with a nice syntax.
upload_time2023-08-18 12:09:58
maintainer
docs_urlNone
authorTammo Ippen
requires_python>=3.11,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![CI](https://github.com/tammoippen/tagic/actions/workflows/CI.yml/badge.svg)](https://github.com/tammoippen/tagic/actions/workflows/CI.yml)
[![PyPi version](https://img.shields.io/pypi/v/tagic.svg)](https://pypi.python.org/pypi/tagic)
[![Python Versions](https://img.shields.io/badge/python-3.11-brightgreen.svg)](https://img.shields.io/badge/python-3.11-brightgreen.svg)
[![Downloads](https://static.pepy.tech/badge/tagic/month)](https://pepy.tech/project/tagic)
[![codestyle black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
# tagic

Build html / xhtml with a nice syntax.

## Goals

- generate html / xhtml with a nice syntax
- have typing support
- have editor support for arguments, I used MDN as a reference.
- KISS: no more than generation

## Install

```sh
> pip install tagic
```

## Example

```py
from tagic.html import *

print(
    html[
      head[
          title["Example Website"],
          meta(
              name="description",
              content="This is an example website build with tagic",
          ),
      ],
      body[
          header(id="header")[h1["Awesome"]],
          main[p["Some text ", span["with tags"], "in between"]],
          footer(hidden=True),
      ],
  ].render(indent=True)
)
```

Will return

```html
<!DOCTYPE html>
<html>
  <head>
    <title>
      Example Website
    </title>
    <meta content="This is an example website build with tagic" name="description" />
  </head>
  <body>
    <header id="header">
      <h1>
        Awesome
      </h1>
    </header>
    <main>
      <p>
        Some text
        <span>
          with tags
        </span>
        in between
      </p>
    </main>
    <footer hidden />
  </body>
</html>
```

## Similar Projects

- [dominate](https://github.com/Knio/dominate): missing the typing support and editor support for arguments
- [domonic](https://github.com/byteface/domonic): to broad of a scope, with parsing, js and style and queries.
- [domini](https://gitlab.com/deepadmax/domini): missing editor support for arguments
- [htmler](https://github.com/ashep/htmler): missing the typing support and editor support for arguments
- [PyHTML](https://github.com/cenkalti/pyhtml): missing the typing support and editor support for arguments
- [pyhtmlgen](https://github.com/danvran/pyhtmlgen): incomplete
- [html](https://pypi.org/project/html/): i do not like syntax and missing the typing support and editor support for arguments
- [MarkupPy](https://github.com/tylerbakke/MarkupPy)
- [yattag](https://www.yattag.org/): i do not like syntax
- [py-microhtml](https://github.com/elonen/py_microhtml): funny tag names and no editor support for arguments
- [py3html](https://github.com/ozcanyarimdunya/py3html): no editor support for arguments
- [fast-html](https://github.com/pcarbonn/fast_html)
- [py2html](https://github.com/am230/py2html) not in pypi, but i like the syntax and took inspiration

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tammoippen/tagic",
    "name": "tagic",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Tammo Ippen",
    "author_email": "tammo.ippen@posteo.de",
    "download_url": "https://files.pythonhosted.org/packages/a4/6a/1f39857cfe13ab2d211f82c383bda9758a0d96702858dc6ae239410bb5c6/tagic-1.0.4.tar.gz",
    "platform": null,
    "description": "[![CI](https://github.com/tammoippen/tagic/actions/workflows/CI.yml/badge.svg)](https://github.com/tammoippen/tagic/actions/workflows/CI.yml)\n[![PyPi version](https://img.shields.io/pypi/v/tagic.svg)](https://pypi.python.org/pypi/tagic)\n[![Python Versions](https://img.shields.io/badge/python-3.11-brightgreen.svg)](https://img.shields.io/badge/python-3.11-brightgreen.svg)\n[![Downloads](https://static.pepy.tech/badge/tagic/month)](https://pepy.tech/project/tagic)\n[![codestyle black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n# tagic\n\nBuild html / xhtml with a nice syntax.\n\n## Goals\n\n- generate html / xhtml with a nice syntax\n- have typing support\n- have editor support for arguments, I used MDN as a reference.\n- KISS: no more than generation\n\n## Install\n\n```sh\n> pip install tagic\n```\n\n## Example\n\n```py\nfrom tagic.html import *\n\nprint(\n    html[\n      head[\n          title[\"Example Website\"],\n          meta(\n              name=\"description\",\n              content=\"This is an example website build with tagic\",\n          ),\n      ],\n      body[\n          header(id=\"header\")[h1[\"Awesome\"]],\n          main[p[\"Some text \", span[\"with tags\"], \"in between\"]],\n          footer(hidden=True),\n      ],\n  ].render(indent=True)\n)\n```\n\nWill return\n\n```html\n<!DOCTYPE html>\n<html>\n  <head>\n    <title>\n      Example Website\n    </title>\n    <meta content=\"This is an example website build with tagic\" name=\"description\" />\n  </head>\n  <body>\n    <header id=\"header\">\n      <h1>\n        Awesome\n      </h1>\n    </header>\n    <main>\n      <p>\n        Some text\n        <span>\n          with tags\n        </span>\n        in between\n      </p>\n    </main>\n    <footer hidden />\n  </body>\n</html>\n```\n\n## Similar Projects\n\n- [dominate](https://github.com/Knio/dominate): missing the typing support and editor support for arguments\n- [domonic](https://github.com/byteface/domonic): to broad of a scope, with parsing, js and style and queries.\n- [domini](https://gitlab.com/deepadmax/domini): missing editor support for arguments\n- [htmler](https://github.com/ashep/htmler): missing the typing support and editor support for arguments\n- [PyHTML](https://github.com/cenkalti/pyhtml): missing the typing support and editor support for arguments\n- [pyhtmlgen](https://github.com/danvran/pyhtmlgen): incomplete\n- [html](https://pypi.org/project/html/): i do not like syntax and missing the typing support and editor support for arguments\n- [MarkupPy](https://github.com/tylerbakke/MarkupPy)\n- [yattag](https://www.yattag.org/): i do not like syntax\n- [py-microhtml](https://github.com/elonen/py_microhtml): funny tag names and no editor support for arguments\n- [py3html](https://github.com/ozcanyarimdunya/py3html): no editor support for arguments\n- [fast-html](https://github.com/pcarbonn/fast_html)\n- [py2html](https://github.com/am230/py2html) not in pypi, but i like the syntax and took inspiration\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Build html / xhtml with a nice syntax.",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://github.com/tammoippen/tagic"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a46a1f39857cfe13ab2d211f82c383bda9758a0d96702858dc6ae239410bb5c6",
                "md5": "a46278fe9453cae97dee08af252c6a9c",
                "sha256": "1b80c46a2b8303f51ce76476ef032ff25c4c70a27fe763bafe4cb4c6290b4db6"
            },
            "downloads": -1,
            "filename": "tagic-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "a46278fe9453cae97dee08af252c6a9c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4.0",
            "size": 13023,
            "upload_time": "2023-08-18T12:09:58",
            "upload_time_iso_8601": "2023-08-18T12:09:58.038635Z",
            "url": "https://files.pythonhosted.org/packages/a4/6a/1f39857cfe13ab2d211f82c383bda9758a0d96702858dc6ae239410bb5c6/tagic-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-18 12:09:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tammoippen",
    "github_project": "tagic",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tagic"
}
        
Elapsed time: 0.62481s