No description
  • Python 54.9%
  • HTML 44.3%
  • Dockerfile 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Johnson ec06f64c0b
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
Create deploy.yml
2026-07-18 13:59:56 -04:00
.github/workflows Create deploy.yml 2026-07-18 13:59:56 -04:00
images made it webber 2026-07-07 23:00:42 -04:00
templates Add template persistence with management UI 2026-07-15 20:53:54 -04:00
.gitignore Add template persistence with management UI 2026-07-15 20:53:54 -04:00
app.py fixes created_at bug 2026-07-18 13:56:35 -04:00
docker-compose.yml Add template persistence with management UI 2026-07-15 20:53:54 -04:00
Dockerfile made it webber 2026-07-07 23:00:42 -04:00
generate_labels.py Initial commit 2026-07-07 21:32:40 -04:00
output1.docx Initial commit 2026-07-07 21:32:40 -04:00
output015.docx Initial commit 2026-07-07 21:32:40 -04:00
PLS171-2.625x2.docx mmmmmm 2026-07-15 21:19:18 -04:00
README.md Add template persistence with management UI 2026-07-15 20:53:54 -04:00
requirements.txt made it webber 2026-07-07 23:00:42 -04:00
template.docx Initial commit 2026-07-07 21:32:40 -04:00

Label Generator

Upload a .docx label template and a bunch of images — get back a populated .docx with images placed in the template table, one page at a time.

Quick Start

docker compose up -d --build

Open http://localhost:8999 in your browser.

How It Works

  1. Drop your template — a .docx file containing a table (wide columns = image slots, narrow columns = gutters).
  2. Drop your images — PNG, JPG, GIF, BMP, WebP. They're sorted alphabetically and placed left-to-right, top-to-bottom.
  3. Set padding — independently control top, right, bottom, left padding (inches) around each image. Presets make it easy.
  4. Generate — the output .docx downloads automatically.

Cells are never resized or moved. Pages are cloned from the template until all images are placed.

Running Locally

pip install -r requirements.txt
python app.py
# → http://localhost:8999

Docker

# Build and run
docker compose up -d --build

# View logs
docker compose logs -f

# Stop
docker compose down

The container listens on port 8999.

Deployment

The docker-compose.yml is ready for any orchestrator (Swarm, Kubernetes, etc.). Just point it at the repo and deploy:

docker stack deploy -c docker-compose.yml label-gen

Tech

  • Flask + Gunicorn (2 workers, 300s timeout)
  • python-docx for template cloning and image insertion
  • Pillow for image size detection
  • All processing happens server-side; no browser JS magic