Skip to main content

Generate HTML using python and also convert to PDF.

Project description

Easy HTML

Generate HTML using python and also convert to PDF.

Installation

pip install py-easy-html

Getting started

General usage

h1 = generate_tag('h1', body='This is a h1', class_name="your_class", id_name="your_id", self_closing=False)

Output

<h1 class="your_class" id="your_id">This is a h1</h1>

<!-- With self_closing=True -->
<h1 class="your_class" id="your_id" />

You can also do nested tags

h1 = generate_tag('h1', body=generate_tag('span', body='Span inside h1'))

Output

<h1>
  <span>Span inside h1</span>
</h1>

And also multiple nested tags

h1 = generate_tag(
        'h1',
        style={
          "display": "flex",
          "justify-content": "space-between",
          "align-items": "center",
        },
        body=[
            generate_tag('span', body='First Span'),
            generate_tag('span', body='Second'),
        ],
    )

Output

<h1 style="display: flex;justify-content: space-between;align-items: center;">
  <span>First Span</span>
  <span>Second</span>
</h1>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-easy-html-0.0.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

py_easy_html-0.0.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file py-easy-html-0.0.2.tar.gz.

File metadata

  • Download URL: py-easy-html-0.0.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.0

File hashes

Hashes for py-easy-html-0.0.2.tar.gz
Algorithm Hash digest
SHA256 52d1fc19d22d76abd392e047bc9668f1c2922f6cfd619902782ff1fd1ff271e2
MD5 0fcb9717d40e429206143940cb3005ef
BLAKE2b-256 4dbdc72c37765cbb3a695b3c1889243527464dd60cb602375dbc21f267e730d8

See more details on using hashes here.

File details

Details for the file py_easy_html-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for py_easy_html-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f4c7bfddf732c4a04f6140361239b8efbca2ef6285d8af8c1dc19073c48bb32a
MD5 e37a9c339c9a197c4767faf4ff3057e4
BLAKE2b-256 3bb2fd5a1abd6ec17d48adf239203b4bec16a7ad587f99996c6118c5a796312f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page