{"id":18354410,"url":"https://github.com/gabrielhora/stempl","last_synced_at":"2026-04-30T15:31:19.118Z","repository":{"id":52705012,"uuid":"134088112","full_name":"gabrielhora/stempl","owner":"gabrielhora","description":"HTML templates with just Python","archived":false,"fork":false,"pushed_at":"2021-04-20T17:22:40.000Z","size":10,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T01:20:56.604Z","etag":null,"topics":["flask","python","python3","templates"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabrielhora.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-19T18:29:47.000Z","updated_at":"2018-07-31T21:29:23.000Z","dependencies_parsed_at":"2022-08-21T19:20:19.620Z","dependency_job_id":null,"html_url":"https://github.com/gabrielhora/stempl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gabrielhora/stempl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielhora%2Fstempl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielhora%2Fstempl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielhora%2Fstempl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielhora%2Fstempl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielhora","download_url":"https://codeload.github.com/gabrielhora/stempl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielhora%2Fstempl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32469344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","python","python3","templates"],"created_at":"2024-11-05T22:03:44.642Z","updated_at":"2026-04-30T15:31:19.104Z","avatar_url":"https://github.com/gabrielhora.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"stempl\n======\n\n|travis|\n\nHTML templates with just Python.\n\nShould I use this?\n------------------\n\nNo. No security concerns were taken into account, this is simply a small pet project.\n\nInstalling\n----------\n\nUse `pip`_ to install the package:\n\n.. code-block:: text\n\n    pip install stempl\n\nExample\n-------\n\nFor more examples checkout the `tests`_ file.\n\n.. code-block:: python\n\n    from flask import Flask\n    from stempl import *\n\n\n    app = Flask(__name__)\n\n\n    def render_head():\n        with Head() as t:\n            t \u003c\u003c meta(charset='utf-8')\n            t \u003c\u003c meta(name='viewport', content='width=device-width, initial-scale=1, shrink-to-fit=no')\n            t \u003c\u003c title('Hello World')\n            t \u003c\u003c link(href='https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css', rel='stylesheet')\n            t \u003c\u003c script(src='https://code.jquery.com/jquery-3.3.1.slim.min.js')\n            t \u003c\u003c script(src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js')\n            t \u003c\u003c script(src='https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js')\n\n        return t()\n\n\n    def render_navbar():\n        with Ul(_class='navbar-nav') as u:\n            u \u003c\u003c li(a('Home', _class='nav-link', href='#'), _class='nav-item active')\n            u \u003c\u003c li(a('Features', _class='nav-link', href='#'), _class='nav-item active')\n            u \u003c\u003c li(a('Pricing', _class='nav-link', href='#'), _class='nav-item active')\n            u \u003c\u003c li(a('Disabled', _class='nav-link disabled', href='#'), _class='nav-item active')\n\n        with Nav(_class='navbar navbar-expand-lg navbar-light bg-light') as n:\n            n \u003c\u003c a('Navbar', _class='navbar-brand', href='#')\n            with Button(_class='navbar-toggler', type='button', data_toggle='collapse', data_target='#navbarNav') as b:\n                b \u003c\u003c span(_class='navbar-toggler-icon')\n            n \u003c\u003c b()\n            n \u003c\u003c div(u(), _class='collapse navbar-collapse', id='navbarNav')\n\n        return n()\n\n\n    def layout(content):\n        with Html() as h:\n            h \u003c\u003c render_head()\n            with Body() as b:\n                b \u003c\u003c render_navbar()\n                b \u003c\u003c div(content, _class='container', id='main')\n            h \u003c\u003c b()\n\n        return doctype() + h()\n\n\n    def index_template():\n        with Div(id='index-page') as d:\n            d \u003c\u003c h1('Hello World')\n\n        return layout(d)\n\n\n    @app.route('/', methods=['GET'])\n    def index():\n        return index_template()\n\n\n    if __name__ == '__main__':\n        app.run(host='0.0.0.0', port=3000, debug=True)\n\n\n\n.. _pip: https://pip.pypa.io/en/stable/quickstart/\n.. _tests: stempl/tests.py\n.. |travis| image:: https://travis-ci.org/gabrielhora/stempl.svg?branch=master\n    :target: https://travis-ci.org/gabrielhora/stempl\n    :alt: Travis CI status\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielhora%2Fstempl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielhora%2Fstempl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielhora%2Fstempl/lists"}