Does anyone know about the Python equivalent of FMPP?

Does anyone know of the Python equivalent for FMPP text file preprocessor?

Follow-up: I read the documents and look at examples of the above sentences. Just for expansion. My use of FMPP is to read in a data file (csv) and use several templates depending on this data to create reports in several html pages related to the main index.

+4
source share
4 answers

Let me add the Mako Exact Fast Tool (and it even uses the $ {var} syntax).

Note: Mako, Jinja and Cheetah are text languages ​​(they process and generate text). I would order them Mako> Jinja> Cheetah (in terms of features and readability), but people's preferences are changing.

Kid and his successor, Genshi , are attribute languages ​​that support HTML / XML ( <div py:if="variable"> ... </div> , etc.). This is a completely different methodology - and tools suitable only for HTML or XML.

+3
source

Python has many templates. It depends on your specific needs.

Jinja2 is good, for example. Kid is different.

+2
source

You can give Cheetah a try. I have used it with some success.

+1
source

I'm not sure exactly what FMPP does, but with a quick glance it looks like a template language.

Jinja2 is a great python template system.

Example:

 <ul> {% for item in list %} <li> {{ item.title }} </li> {% endfor %} </ul> {% if user.is_admin() %} <a href="./edit">Edit this page</a> {% endif %} 
+1
source

All Articles