A Python tool to generate personalized table tents from CSV data and a Word template, with output ready for PDF export.
uv is a fast Python package installer and resolver. Install it from https://docs.astral.sh/uv/getting-started/installation/.
Verify installation:
uv --versionThe Red Hat Display font is required for the Word documents to export to PDF correctly with proper formatting.
Download link: Red Hat Display Font
- Download the font files from the link above
- Unzip the files
- Open the font files and click Install (or copy
.ttffiles toC:\Windows\Fontson Windows)
From the project root directory, run:
uv syncThis will install all required Python packages from pyproject.toml.
Create CSV files with your table tent data. You need one file for each night:
Monday Table Tents.csvTuesday Table Tents.csvWednesday Table Tents.csv
Each CSV must include a header as the very first line, for example: First and Last Name,Table Assignment
After the header, each row should contain two columns:
- First and Last Name — Guest's full name (e.g., "John Smith")
- Table Assignment — Table number and night suffix (e.g., "1A")
Table number ranges by night:
- Monday: 1A–12A
- Tuesday: 1B–12B
- Wednesday: 1C–12C
Example format for Monday night:
First and Last Name,Table Assignment
John Smith,1A
Jane Doe,3A
Robert Johnson,7A
Sample CSV files are included in this repository as templates.
Ensure you have a Word template file named Table Tent Template.docx in the project root. One is already provided that should be good to use as-is. The template should contain three placeholders that will be replaced with actual data:
%FIRNAME%— replaced with first name%LASTNAME%— replaced with last name%TABLE_NUM%— replaced with table number
From the project root directory, run:
uv run main.pyThe script will:
- Read data from each CSV file (Monday, Tuesday, Wednesday)
- Generate personalized table tents from the template
- Combine all tent names/tables for a given night into a single Word document for that night
- Save combined documents to the
Output/directory:Output/Monday Combined.docxOutput/Tuesday Combined.docxOutput/Wednesday Combined.docx
For each combined docx file:
- Open the
.docxfile in Microsoft Word - Go to File → Print
- Select Microsoft Print to PDF as the printer
- Click Print
- Choose a location and save as PDF (default options are fine)
Note: Generating the PDF can take a while (a few minutes). You can watch the progress in the bottom-right corner of Word while the PDF is being created. If you try to open the PDF before it is done exporting, it will be empty and have 0 pages.
You now have PDF table tents ready to print and use!
Issue: Generated PDFs don't have the correct font styling
- Solution: Ensure you've installed the Red Hat Display font (see Prerequisites section 2)
Issue: CSV file not found
- Solution: Ensure your CSV files are named exactly:
Monday Table Tents.csvTuesday Table Tents.csvWednesday Table Tents.csv
- python-docx — Manipulate Word documents
- docxcompose — Combine multiple Word documents
- pandas — Read CSV files
- lxml — Parse and modify Word document XML
All dependencies are listed in pyproject.toml and installed via uv sync.
