Простой генератор HTML-страниц
Project description
HTML Generator
Простой генератор HTML-страниц на Python. Позволяет создавать HTML-файлы на основе шаблонов и данных.
Установка
Установите библиотеку через pip:
pip install htmlgenim
Использование
from html_generator.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
Release history Release notifications | RSS feed
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.3.tar.gz
(2.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file htmlgenim-0.2.3.tar.gz.
File metadata
- Download URL: htmlgenim-0.2.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1b95da1165b68bdd8151d1be903b6dc26d1e0069e5538ad34aec83926677064
|
|
| MD5 |
9714d357a37c5ae3c02476aa63c21903
|
|
| BLAKE2b-256 |
9e3deaa3570b71cb25ae2e7ce3be674b51d48cb53eabcc929085900814439354
|
File details
Details for the file htmlgenim-0.2.3-py3-none-any.whl.
File metadata
- Download URL: htmlgenim-0.2.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b73fcdd48371920b5510bf4174b7567f0b37163c39b164c10158c0c1361f1e2
|
|
| MD5 |
aabf6a092840f58cf5ebf839b99fde3e
|
|
| BLAKE2b-256 |
5dcc856db78b39a881fd620fee5627dc4c4793b0062c676f0e22ba8f3cca5f87
|