Skip to content

Cheetah3 is a free (MIT) and open source template engine for Python.

License

Notifications You must be signed in to change notification settings

CheetahTemplate3/cheetah3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 13, 2025
58692b8 · Jan 13, 2025
Jan 13, 2025
Dec 14, 2024
Nov 19, 2009
Mar 22, 2009
Dec 18, 2024
Dec 2, 2024
Sep 21, 2022
Mar 14, 2017
Dec 2, 2024
Mar 14, 2017
Dec 2, 2024
Jan 2, 2024
Sep 16, 2022
Dec 14, 2024
Dec 2, 2024
Sep 17, 2022
Jan 5, 2018
May 2, 2019
Oct 23, 2024
Oct 23, 2017
Jan 13, 2025

Repository files navigation

Cheetah Template 3.4.0

Cheetah3 is a free and open source (MIT) Python template engine. It's a fork of the original CheetahTemplate library.

Python 2.7 or 3.4+ is required.

Where is CheetahTemplate3

Site: https://cheetahtemplate.org/

Download: https://pypi.org/project/CT3/

News and changes: https://cheetahtemplate.org/news.html

StackOverflow: https://stackoverflow.com/questions/tagged/cheetah

Mailing lists: https://sourceforge.net/p/cheetahtemplate/mailman/

Development: https://github.com/CheetahTemplate3

Developer Guide: https://cheetahtemplate.org/dev_guide/

Example

Install:

$ pip install CT3 # (or even "ct3")

Below is a simple example of some Cheetah code, as you can see it's practically Python. You can import, inherit and define methods just like in a regular Python module, since that's what your Cheetah templates are compiled to :)

#from Cheetah.Template import Template
#extends Template

#set $people = [{'name' : 'Tom', 'mood' : 'Happy'}, {'name' : 'Dick',
                        'mood' : 'Sad'}, {'name' : 'Harry', 'mood' : 'Hairy'}]

<strong>How are you feeling?</strong>
<ul>
    #for $person in $people
        <li>
            $person['name'] is $person['mood']
        </li>
    #end for
</ul>