Python with Jinja2 .
import jinja import csv env= jinja.Environment() env.loader= jinja.FileSystemLoader("some/directory") template= env.get_template( "name" ) rdr= csv.reader( open("some.csv", "r" ) ) csv_data = [ row for row in rdr ] print template.render( data=csv_data )
Turns out you could leave just by passing rdr directly to Jinja for parsing.
If the template looks like this, it will work with a lot of Python structures, including an iterator.
<table> {% for row in data %} <tr> <td>{{ row.0 }}</td><td>{{ row.1 }}</td> </tr> {% endfor %} </table>
source share