Skip to main content

Простой генератор HTML-страниц

Project description

HTML Generator

Простой генератор HTML-страниц на Python. Позволяет создавать HTML-файлы на основе шаблонов и данных.

Установка

Установите библиотеку через pip:

pip install htmlgenim

Использование

from htmlgenim.generator import HTMLGenerator

# Шаблон HTML с переменными
template = """
<!DOCTYPE html>
<html>
<head>
    <title>{{ title }}</title>
</head>
<body>
    <h1>{{ heading }}</h1>
    <p>{{ content }}</p>
</body>
</html>
"""

# Данные для подстановки
data = {
    "title": "Моя страница",
    "heading": "Привет, мир!",
    "content": "Это пример использования HTML генератора."}

# Генерация HTML
generator = HTMLGenerator(template)
html_content = generator.render(**data)

# Сохранение файла в текущей директории
generator.save_to_file(html_content, "output.html")

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

htmlgenim-0.2.4.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

htmlgenim-0.2.4-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file htmlgenim-0.2.4.tar.gz.

File metadata

  • Download URL: htmlgenim-0.2.4.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for htmlgenim-0.2.4.tar.gz
Algorithm Hash digest
SHA256 369c19d1455823c662b5d044cc2fe8ff655d55f3646921cbbe62d4857efd831d
MD5 9560cbc0d10ebf897c28e44d812efa38
BLAKE2b-256 ac342665101535058afb1b96fa198c8069240df208c820098e1a59f12b2f583c

See more details on using hashes here.

File details

Details for the file htmlgenim-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: htmlgenim-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for htmlgenim-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fafe3f7541a91f0e3902f6efb031d59589afe19041329d1400e6437b75fedb7a
MD5 eb18ca580366c812f2f4fc3304c0fa4c
BLAKE2b-256 d9e3a7761a44eb1b0c476bb174f0d7c0bfde9a314b5cbbf6e49f464a53ab3877

See more details on using hashes here.

Supported by

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