I’d like to fill a HTML template with data from Python. While I don’t know any HTML, a colleague of mine would prepare the HTML template whereas I provide the data. However, he knows only little about Python.
Could you suggest a very basic template framework which handles this separation of HTML and Python nicely (i.e. not much special syntax in HTML; and not much HTML for me to know in the Python data code)? Ideally the HTML template should be very close to pure HTML.
I will also have tables as data, so it would be nice if I didn’t have to prepare HTML table code, but instead he could do it with some minimal markup logic.
Ideally the system should work even if my colleague applies more advanced concepts like CSS.
I’ve found the extensive list, but it’s really hard to judge which of the system is closest to my requirements as I don’t know the technical language.
EDIT: the point is we are newbies with that, and we only need a basic solution 🙂 – yet ideally no HTML for me and not much beyond plain HTML for him.
Well django has very nice powerful templating engine, that’s purpose is separating HTML from python logic (but that would require you to use django altogether, so it might be an overkill if you just want templating).
If your templates are really easy (no loops) you might use native python string.format function (I used it in a side project that generated config files to some Fortran code, and it wasn’t so bad).
Other choice might be jinja2 that is really close to django templates, but standalone and more powerful.