Production-grade Jinja2 UI rendering engine for aiogram with keyboard DSL and session sync
Project description
aiogram-jinja-ui
Production-ready Jinja2 UI engine for aiogram with:
- template-driven Telegram text rendering,
- inline/reply keyboard DSL,
- optional photo marker support,
- sync manager for real-time UI updates across sessions.
EN
Features
TelegramUIEnginefor rendering Jinja2 templates into Telegram-ready text + markup.UIManagerfor synchronized UI updates (editwith resend fallback).- Keyboard DSL in templates via special comment blocks (
TG_KB_START/TG_KB_END). - Strong fit for bots with dynamic dashboards, menus, and collaborative views.
Installation
poetry add aiogram-jinja-ui
Or from wheel:
pip install aiogram_jinja_ui-<version>-py3-none-any.whl
Minimal usage
from aiogram_jinja_ui import TelegramUIEngine
ui = TelegramUIEngine("templates")
text, markup, photo = ui.render(
"pages/start.html",
username="den5",
)
Versioning & releases
- Use semantic tags:
vMAJOR.MINOR.PATCH(example:v1.2.0). CIworkflow runs tests/build on push/PR.Releaseworkflow builds wheel+sdist and creates GitHub Release on tag push.- Optional PyPI publish is supported via
PYPI_API_TOKENsecret.
Local development
poetry install --with dev
poetry run pytest -q
poetry build
RU
Возможности
TelegramUIEngineрендерит Jinja2-шаблоны в Telegram-текст и клавиатуры.UIManagerсинхронизирует интерфейс между сессиями (с fallback на resend).- DSL для клавиатур через блоки
TG_KB_START/TG_KB_END. - Подходит для сложных ботов: дашборды, меню, совместные экраны.
Установка
poetry add aiogram-jinja-ui
Или из wheel:
pip install aiogram_jinja_ui-<version>-py3-none-any.whl
Минимальный пример
from aiogram_jinja_ui import TelegramUIEngine
ui = TelegramUIEngine("templates")
text, markup, photo = ui.render(
"pages/start.html",
username="den5",
)
Версионирование и релизы
- Используйте семантические теги:
vMAJOR.MINOR.PATCH(напримерv1.2.0). - Workflow
CIзапускает тесты и сборку на push/PR. - Workflow
Releaseпубликует артефакты (wheel+sdist) в GitHub Releases по тегу. - Публикация в PyPI поддерживается через секрет
PYPI_API_TOKEN.
Локальная разработка
poetry install --with dev
poetry run pytest -q
poetry build
GitHub quick start
git init
git add .
git commit -m "feat: production-ready packaging, README EN/RU, CI/release workflows"
git branch -M main
git remote add origin https://github.com/dEN5-tech/aiogram-jinja-ui.git
git push -u origin main
Create first release:
git tag v1.0.0
git push origin v1.0.0
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
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 aiogram_jinja_ui-1.0.3.tar.gz.
File metadata
- Download URL: aiogram_jinja_ui-1.0.3.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ab59d44a91684ed99f9f458cdd486d54b33baf3ef4babe96f63a3698ae838bb
|
|
| MD5 |
11a8014f2846e3bd0dbe45624842fdff
|
|
| BLAKE2b-256 |
a94afa5d123627ff3088b45511be3b650e722a191c6e7baa12eb3549a16cdc66
|
Provenance
The following attestation bundles were made for aiogram_jinja_ui-1.0.3.tar.gz:
Publisher:
release.yml on dEN5-tech/aiogram-jinja-ui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiogram_jinja_ui-1.0.3.tar.gz -
Subject digest:
8ab59d44a91684ed99f9f458cdd486d54b33baf3ef4babe96f63a3698ae838bb - Sigstore transparency entry: 1096998671
- Sigstore integration time:
-
Permalink:
dEN5-tech/aiogram-jinja-ui@eff49ff7951a1b71b57d217907f35de8ba809346 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/dEN5-tech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@eff49ff7951a1b71b57d217907f35de8ba809346 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aiogram_jinja_ui-1.0.3-py3-none-any.whl.
File metadata
- Download URL: aiogram_jinja_ui-1.0.3-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a86507a2cc026d71d3167524a5029e282d93b7adf4c1f588cbbd7121eb6c6ed
|
|
| MD5 |
973b3b4463542713b7d74eccb3f03654
|
|
| BLAKE2b-256 |
e3d843b5ed901501336b62ec87c745b192e1277c3f98e65a0cd46ffad9d827cd
|
Provenance
The following attestation bundles were made for aiogram_jinja_ui-1.0.3-py3-none-any.whl:
Publisher:
release.yml on dEN5-tech/aiogram-jinja-ui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiogram_jinja_ui-1.0.3-py3-none-any.whl -
Subject digest:
1a86507a2cc026d71d3167524a5029e282d93b7adf4c1f588cbbd7121eb6c6ed - Sigstore transparency entry: 1096998692
- Sigstore integration time:
-
Permalink:
dEN5-tech/aiogram-jinja-ui@eff49ff7951a1b71b57d217907f35de8ba809346 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/dEN5-tech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@eff49ff7951a1b71b57d217907f35de8ba809346 -
Trigger Event:
push
-
Statement type: