Generate printable nametags with barcodes from Excel/CSV data
Project description
NimiLappuGen
NimiLappuGen is a tool designed to generate printable nametags. It allows users to create print-ready nametags of any specified dimension, displaying the person's forenames and surname on separate lines, a 5-digit barcode, and customizable background graphics.
Key Features
- Two-Line Personalized Names: Clearly displays the forenames and surname of the person on separate lines, with auto-scaling fonts to ensure names fit neatly.
- Optional Subchapter: Text for a role or group can be provided to automatically neatly fit below the person's name and above the barcode.
- Adjustable Header Text: Includes a small top-left header text (defaults to "Kevätkokous Jyväskylässä 10.-12.4.2026").
- Excel and CSV Data Import: Seamlessly read lists of names (
forenames,surname) and their corresponding 5-digit numbers (number) directly from an Excel spreadsheet or CSV file. - Custom Nametag Sizes: Define the exact width and height for your nametags to fit any standard or custom badge holder.
- 5-Digit Barcodes: Automatically generates a barcode for each nametag based on a unique 5-digit number, ideal for event registration, tracking, or access control.
- Customizable Background Graphics: Apply your own graphic designs, logos, or event branding as the background for the nametags.
- Print-Ready Output: Easily export the generated nametags into a printable format (e.g., PDF or an image grid).
Planned Usage
- Provide Background Art: Select an image file to serve as the background template (default
assets/dummy_bg.jpg). - Define Dimensions: Input your target width and height for the printed nametag (defaults to
1000x600). - Input Data: Provide an Excel sheet or a CSV file containing
forename/first,surname/last,subchapter/rooli, andnumber/idcolumns. - Generate: The program outputs the final printable artifact combining the background, the generated barcode, and the individual's name formatted correctly.
Usage
Simple Usage without installing
uvx nimilappugen --data names.csv --pdf
Install Requirements
# 1. Create a virtual environment
python -m venv venv
# 2. Activate it (Windows)
venv\Scripts\activate
# 2. Activate it (Mac/Linux)
# source venv/bin/activate
# 3. Install dependencies
pip install -r requirements.txt
Basic Usage
To generate individual PNGs for each nametag listed in your data file:
python generate.py --data data.csv
Generate a Printable PDF Grid
To automatically arrange the output nametags onto an A4 PDF for printing:
python generate.py --data data.csv --pdf
Creating Test Samples
If you just want to test out dimensions, font scaling, or backgrounds without providing a valid data file, the generator will automatically produce 50 test samples and optionally arrange them into a PDF:
python generate.py --data missing_file.csv --pdf
Available arguments:
--data/-d/--excel/-e: Path to Excel or CSV file.--bg/-b: Path to background image.--header: Small header text for the upper-left corner (defaults to "Kevätkokous Jyväskylässä 10.-12.4.2026").--width/-W: Width of the generated nametags.--height/-H: Height of the generated nametags.--font/-f: Path to a custom.ttffont file (falls back to system fonts automatically).--pdf: Flag to create an A4 PDF grid.--pdf-name: Output filename for the PDF (defaults tonametags_print.pdf).--output-dir/-o: Output folder (defaults tooutput/).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nimilappugen-0.5.0.tar.gz.
File metadata
- Download URL: nimilappugen-0.5.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b71378ccdbf01754d169076bfd767422f8671732808060571301121c714f553
|
|
| MD5 |
48b393e6e28924dba3094d7ba3cf4a70
|
|
| BLAKE2b-256 |
06a3f8297d5f5d73c8534a19626bae4b2f05f10f4ade4bc72b96a4f75a7a5164
|
File details
Details for the file nimilappugen-0.5.0-py3-none-any.whl.
File metadata
- Download URL: nimilappugen-0.5.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af55c99b4e84203963dd5fbbd7e8f8ff4a72e9787af8f8161dbd3f08250e5776
|
|
| MD5 |
6d177e28b977583105daeff129e5d69a
|
|
| BLAKE2b-256 |
f06303d25cc5140ba673b22fcdbef16bcd9c50f74a64420227aa8f229e1f5865
|