A fast, strongly typed html templating library for python
Project description
Tempered (Beta)
A modern html templating library for python
Documentation | PyPi | Github |
---|
pip install tempered
Features
- Fast: Sub-millisecond render times. Roughly 5x faster than jinja, 50x faster than django
- Scoped and Bundled CSS: CSS is scoped per file and then bundled together into a single stylesheet per page
- Native Preprocesser Support: Native support for Sass and Typescript
- Component Based: Each template is a components and can call other components
- Layouts: Templates can use layouts, based on jinja2's implementation
- Dyanimcly Typed: Optional dynamic type information can be built with components for better intelisense.
from tempered import Tempered
tempered = Tempered("./templates")
html = tempered.render_template("image.html",
src="/example.png",
alt="Example Post",
)
print(html)
<!-- templates/Image.html -->
{% param src: str %}
{% param alt: str = "" %}
<img src="{{src}}" alt="{{alt}}">
<style>
img {
width: 100px;
height: 100px;
}
</style>
<img alt="Example Post" src="/example.png" class=image-83dc><style>img.image-83dc{width:100px;height:100px}</style>
Transpiled
Templates are transpiled into python functions to provide increased performance.
Type Hinted
Dynamically created type information allows improved IDE intergration.
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
tempered-0.10.0.tar.gz
(32.5 kB
view details)
Built Distribution
tempered-0.10.0-py3-none-any.whl
(34.6 kB
view details)
File details
Details for the file tempered-0.10.0.tar.gz
.
File metadata
- Download URL: tempered-0.10.0.tar.gz
- Upload date:
- Size: 32.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fafc29df6ccef39112cc33b26df3feaa347dc436d486f625407037592ced614 |
|
MD5 | 0ae519314410920c27f7f63780a03243 |
|
BLAKE2b-256 | 04db5e222434cfd3449b17bed2b73afd0bb99885f50585c81f45895bedfd3cf5 |
File details
Details for the file tempered-0.10.0-py3-none-any.whl
.
File metadata
- Download URL: tempered-0.10.0-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46bf1dd867ec00e23863d52ec4f1191fe2d520c498b8840e66764d246b3cde57 |
|
MD5 | ac19a7b50da0d2cab04ef89a5283a36c |
|
BLAKE2b-256 | ba9032f380fba861c664476e5da59707f5214e4f23750e8e0c7f273743f3f8c1 |