Skip to main content

Python Templates is an Apache2 licensed html templating library, written in pure-Python, including popular HTML templates like Bootstrap.

TODO

Python Templates is a work-in-progress.

  • Improve semantic components?

    • What should be a function vs class? Currently, it’s mostly just inheritance with methods. That feels basic to me. At the other extreme is an element-tree api with visitor pattern. I think the significance of this project is finding the balance between those too.

    • This project seems to go against “flat is better than nested”. But I like the idea of using regular Python for template features like: if-statements, for-loops, and inheritance.

  • Add more front-end frameworks.

  • Demo project ideas:

    • Link shortener

    • E-commerce page

    • Blog

  • Include images, fonts, icons?

  • See also:

Testimonials

Does your company or website use Python Templates? Send us a message and let us know.

Features

  • Pure-Python

  • Popular HTML templates included!

Quickstart

Installing Python Templates is simple with pip:

$ pip install templates

You can access documentation in the interpreter with Python’s built-in help function. The help works on modules, classes and methods in Python Templates.

>>> import templates
>>> help(templates)
>>> from templates import bootstrap
>>> help(bootstrap)
>>> help(bootstrap.Starter)
>>> help(bootstrap.Jumbotron)

There’s also a demo which you can run using bottle:

$ pip install bottle
$ python -m templates.demo

Python Templates License

Copyright 2018 Grant Jenks

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Release files for templates 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for templates 0.0.5
File Size Uploaded
templates-0.0.5.tar.gz 72.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for templates 0.0.5
File Interpreter ABI Platform
templates-0.0.5-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 146.3 kB

Release files / templates-0.0.5.tar.gz

Download URL templates-0.0.5.tar.gz
Size 72.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3465eb4cb0d43f236178b123b9a6005c7b78415c7bc65c7fb5568bf6bf4dc8cf
BLAKE2b-256 checksum
How to use checksums
59ab652b095810cca1e2da1c97638c91e654462a83c838c264ca409378bc0bd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / templates-0.0.5-py2.py3-none-any.whl

Download URL templates-0.0.5-py2.py3-none-any.whl
Size 73.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5a0e00ee4884d5c1419afb3821437a3e3a849c7c12523886a15eb90e5d5ad20e
BLAKE2b-256 checksum
How to use checksums
39910fc9774f514285a8fafc5a43715e3027997ccea60886faae28052c4fb0ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page