Skip to main content

A super-fast templating language that borrows the best ideas from the existing templating languages.

Project description

Mako is a template library written in Python. It provides a familiar, non-XML syntax which compiles into Python modules for maximum performance. Mako’s syntax and API borrows from the best ideas of many others, including Django templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded Python (i.e. Python Server Page) language, which refines the familiar ideas of componentized layout and inheritance to produce one of the most straightforward and flexible models available, while also maintaining close ties to Python calling and scoping semantics.

Nutshell

<%inherit file="base.html"/>
<%
    rows = [[v for v in range(0,10)] for row in range(0,10)]
%>
<table>
    % for row in rows:
        ${makerow(row)}
    % endfor
</table>

<%def name="makerow(row)">
    <tr>
    % for name in row:
        <td>${name}</td>\
    % endfor
    </tr>
</%def>

Philosophy

Python is a great scripting language. Don’t reinvent the wheel…your templates can handle it !

Documentation

See documentation for Mako at https://docs.makotemplates.org/en/latest/

License

Mako is licensed under an MIT-style license (see LICENSE). Other incorporated projects may be licensed under different licenses. All licenses allow for non-commercial and commercial use.

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

mako-1.3.10.tar.gz (392.5 kB view details)

Uploaded Source

Built Distribution

mako-1.3.10-py3-none-any.whl (78.5 kB view details)

Uploaded Python 3

File details

Details for the file mako-1.3.10.tar.gz.

File metadata

  • Download URL: mako-1.3.10.tar.gz
  • Upload date:
  • Size: 392.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mako-1.3.10.tar.gz
Algorithm Hash digest
SHA256 99579a6f39583fa7e5630a28c3c1f440e4e97a414b80372649c0ce338da2ea28
MD5 c9dfb2bf42827459dd505c60f2262a7c
BLAKE2b-256 9e38bd5b78a920a64d708fe6bc8e0a2c075e1389d53bef8413725c63ba041535

See more details on using hashes here.

File details

Details for the file mako-1.3.10-py3-none-any.whl.

File metadata

  • Download URL: mako-1.3.10-py3-none-any.whl
  • Upload date:
  • Size: 78.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mako-1.3.10-py3-none-any.whl
Algorithm Hash digest
SHA256 baef24a52fc4fc514a0887ac600f9f1cff3d82c61d4d700a1fa84d597b88db59
MD5 ee354da14303f6302663c797849c1452
BLAKE2b-256 87fb99f81ac72ae23375f22b7afdb7642aba97c00a713c217124420147681a2f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page