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

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 .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.5.0.tar.gz (9.2 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.5.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

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

Hashes for nimilappugen-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1b71378ccdbf01754d169076bfd767422f8671732808060571301121c714f553
MD5 48b393e6e28924dba3094d7ba3cf4a70
BLAKE2b-256 06a3f8297d5f5d73c8534a19626bae4b2f05f10f4ade4bc72b96a4f75a7a5164

See more details on using hashes here.

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

Hashes for nimilappugen-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af55c99b4e84203963dd5fbbd7e8f8ff4a72e9787af8f8161dbd3f08250e5776
MD5 6d177e28b977583105daeff129e5d69a
BLAKE2b-256 f06303d25cc5140ba673b22fcdbef16bcd9c50f74a64420227aa8f229e1f5865

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