No description
- Python 54.9%
- HTML 44.3%
- Dockerfile 0.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
|
||
| .github/workflows | ||
| images | ||
| templates | ||
| .gitignore | ||
| app.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| generate_labels.py | ||
| output1.docx | ||
| output015.docx | ||
| PLS171-2.625x2.docx | ||
| README.md | ||
| requirements.txt | ||
| template.docx | ||
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
- Drop your template — a
.docxfile containing a table (wide columns = image slots, narrow columns = gutters). - Drop your images — PNG, JPG, GIF, BMP, WebP. They're sorted alphabetically and placed left-to-right, top-to-bottom.
- Set padding — independently control top, right, bottom, left padding (inches) around each image. Presets make it easy.
- Generate — the output
.docxdownloads 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