Skip to main content

kamo is almost subset of mako, maybe

Project description

almost subset of mako. this is a toy package.

don’t use in production!!

# -*- coding:utf-8 -*-
import logging
from kamo import Template

template = Template("""
def decorate(s):
    return "** {} **".format(s)
<%!from datetime import datetime%>

${name}: this is my first sample! (now: ${})

print(template.render(name="foo", greeting="chears"))
print(template.render(name="boo", greeting="chears"))

generated function is such as below.

from datetime import datetime

def render(io, **c):
    write = io.write
    def decorate(s):
        return "** {} **".format(s)

    write(': this is my first sample! (now: ')

lookup template


${name}: yup

from kamo import TemplateManager
tm = TemplateManager(directories=["."])
template = tm.lookup("foo.kamo")    # find template from ["./foo.kamo"]

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for kamo, version 0.0
Filename, size File type Python version Upload date Hashes
Filename, size kamo-0.0.tar.gz (9.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page