TenTags logo

TenTags

A declarative template language for automated HTML, Excel, and PDF document generation.

Why TenTags?

TenTags is built for programs and AI agents, not manual editing. It makes dynamic table and document generation simple, readable, and reliable.

Generate programmatically

Compose templates with Python loops, f-strings, or AI-generated formulas instead of manually writing HTML or spreadsheet APIs.

Multiple output targets

Compile the same template to HTML, Excel (.xlsx), or PDF with a unified intermediate representation.

Rich styling support

Use inline tags for font size, colors, alignment, merges, and background fills.

AI-friendly DSL

Compact syntax reduces hallucination risk when generating tables from large language models.

Quick start

pip install tentags

For Excel export, install the optional dependency:

pip install tentags[excel]

For PDF export:

pip install tentags[pdf]
TenTags report example

Example

import tentags

employees = [
  {"name": "Alice", "salary": "$120,000", "dept": "Engineering"},
  {"name": "Bob", "salary": "$95,000", "dept": "Design"}
]

formula = f'''
3,3,1,"#cbd5e1","solid",0,40, data(
  Name,
  Salary,
  Department;
  {rows}
)'''

model = tentags.parse(formula)
html = tentags.render_html(model)

Official public portal

This site is a standalone public portal for the TenTags project, separate from the Python package repository. It is designed to showcase the library, its features, and installation information.

TenTags example screenshot

Declarative table formulas

TenTags formulas include a preamble and data block for expressive table layout and styling. Use tags like <bg=#...>, <color=...>, <cm>, and <rm>.