Skip to content

JacksonCDaniel/TableTentGenerator

Repository files navigation

Table Tent Generator

A Python tool to generate personalized table tents from CSV data and a Word template, with output ready for PDF export.

Prerequisites

1. Install UV (if needed)

uv is a fast Python package installer and resolver. Install it from https://docs.astral.sh/uv/getting-started/installation/.

Verify installation:

uv --version

2. Install "Red Hat Display" Font

The Red Hat Display font is required for the Word documents to export to PDF correctly with proper formatting.

Download link: Red Hat Display Font

  1. Download the font files from the link above
  2. Unzip the files
  3. Open the font files and click Install (or copy .ttf files to C:\Windows\Fonts on Windows)

3. Install Project Dependencies

From the project root directory, run:

uv sync

This will install all required Python packages from pyproject.toml.

Usage

Step 1: Prepare Your Data

Create CSV files with your table tent data. You need one file for each night:

  • Monday Table Tents.csv
  • Tuesday Table Tents.csv
  • Wednesday 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.

Step 2: Prepare the Template

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

Step 3: Run the Generator

From the project root directory, run:

uv run main.py

The 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.docx
    • Output/Tuesday Combined.docx
    • Output/Wednesday Combined.docx

Sample output: Screenshot of Microsoft Word with John Smith table tent

Step 4: Export to PDF

For each combined docx file:

  1. Open the .docx file in Microsoft Word
  2. Go to FilePrint
  3. Select Microsoft Print to PDF as the printer
  4. Click Print
  5. 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!

Troubleshooting

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.csv
    • Tuesday Table Tents.csv
    • Wednesday Table Tents.csv

Dependencies

  • 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.

About

Generates table tent DOCX files from a template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages