CSV Samples¶
Data File¶
a b c
Eins Zwei Drei
1 2 3
I II III
Template File¶
.. -*- mode: rst -*-
Static Heading
--------------
Individual Cell in Row
~~~~~~~~~~~~~~~~~~~~~~
{{ data[0].a }}
List of Cells in Row
~~~~~~~~~~~~~~~~~~~~
{% for item in data[0].items() %}
- {{item[0]}}: {{item[1]}}
{% endfor %}
Mapping Series Table
~~~~~~~~~~~~~~~~~~~~
Rendering a table from a list of nested dictionaries using dynamic
headers.
{{ make_list_table_from_mappings(
[('One', 'a'), ('Two', 'b'), ('Three', 'c')],
data,
title='Table from series of mappings',
) }}
Loading the Template¶
.. datatemplate:csv:: sample.csv
:template: csv-sample.tmpl
:headers:
:dialect: excel-tab
Rendered Output¶
Static Heading¶
Individual Cell in Row¶
Eins
List of Cells in Row¶
a: Eins
b: Zwei
c: Drei
Mapping Series Table¶
Rendering a table from a list of nested dictionaries using dynamic headers.
One |
Two |
Three |
---|---|---|
Eins |
Zwei |
Drei |
1 |
2 |
3 |
I |
II |
III |