Skip to main content

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

  1. Provide Background Art: Select an image file to serve as the background template (default assets/dummy_bg.jpg).
  2. Define Dimensions: Input your target width and height for the printed nametag (defaults to 1000x600).
  3. Input Data: Provide an Excel sheet or a CSV file containing forename/first, surname/last, subchapter/rooli, and number/id columns.
  4. Generate: The program outputs the final printable artifact combining the background, the generated barcode, and the individual's name formatted correctly.

Usage

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 .ttf font file (falls back to system fonts automatically).
  • --pdf: Flag to create an A4 PDF grid.
  • --pdf-name: Output filename for the PDF (defaults to nametags_print.pdf).
  • --output-dir / -o: Output folder (defaults to output/).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nimilappugen-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nimilappugen-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file nimilappugen-0.1.0.tar.gz.

File metadata

  • Download URL: nimilappugen-0.1.0.tar.gz
  • Upload date:
  • Size: 8.9 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

Hashes for nimilappugen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4dfce4f626634b107a683dd9df9b65bab8815473aa85eb46d8116b6a235696f6
MD5 d3e3c5fd15caf499b8f9f7d41dcf65f7
BLAKE2b-256 d699c380a13347263fd5bb1c4e9e6090552870d5eda113e758e7a97933837f5d

See more details on using hashes here.

File details

Details for the file nimilappugen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nimilappugen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 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

Hashes for nimilappugen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1402f8b4504733983cc7d4846e9c608ead43679b6836c7e63e13c97615ec725
MD5 1ae286bb4b80f628750bfa477dadc364
BLAKE2b-256 39b77a8ceb7c2ee2f7d9c322070677d2742acf5701bcdd3df8be9a745954bc38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page