LabelNation: a command-line label-printing program

Latest version: 1.182

LabelNation is a command-line program for making labels. By "label", I mean address labels, business cards, or anything else involving regularly-arranged rectangles on a printer-ready sheet. You can even use it to make a calendar (that took some work, though). LabelNation is open source software, licenced under the GNU General Public Licence (GPL).

Here's how it works: you tell LabelNation what text you want on each label. You can specify plain lines of text, or even arbitrary PostScript code. You also tell it what kind of labels it should print for. LabelNation takes all this information and produces a PostScript file, which you then send to your PostScript printer (or through a filter such as GNU GhostScript). Of course, there must be a sheet of peel-off labels in the paper tray. Such sheets are widely available at office supply stores. Two companies that offer it are Avery Dennison and Maco. This is not a recommendation nor an endorsement; Avery and Maco are simply the names I've seen.

LabelNation does automatic font resizing to fit all the lines of text on the label, supports the usual accented characters (á, à, ó, etc, from ISO 8859-1), and has built-in knowledge of the following standard label types:


  4 labels per page:      Avery-5168
  6 labels per page:      Avery-5264                             
  10 labels per page:     Avery-5263, 5663, 5963, 8163
  20 labels per page:     Avery-5161, 5261, 5661, 5961
  14 labels per page:     Avery-5162, 5262, 5662, 5962, 8162, 8252, 8462,
                                15162, 18162, 18662
  30 labels per page:     Avery-5160, 5260, 5660, 5960, 5970, 5971, 5972,
                                5979, 5980, 6241, 6460, 6245, 8660
                          Maco-LL5805
  80 labels per page:     Avery-5167, 5267, 5667, 6467, 8167
                          Maco-LL8100                            
  10 bcards per page:     Avery-5371, Maco-LL8550
  16 labels per page:     Avery-7162
  32 labels per page:     Avery-6571
  21 labels per A4 page:  Avery-7160
  24 labels per A4 page:  Avery-7159
  65 labels per A4 page:  Avery-2651
  8 labels per 10" page:  Avery-2160, Maverick-ST340817

Types not listed above are still supported -- you just have to tell LabelNation what sizes the labels are, and how many per page vertically and horizontally. (And then please send in your parameters, so there will be built-in support for those labels in future releases.)

LabelNation requires Python, and a user who's comfortable dealing with text- and option-based configuration, as opposed to a graphical user interface.

Still interested? Then

If you have a bug to report, or would like to send in parameters for a new label type, please email bug-labelnation@red-bean.com.

Other Programs That Do Similar Things

There seem to be a number of templates at Google Docs that offer label formatting essentially as an online service. I haven't tried this myself.

You might also want to try the PostScript::MailLabel Perl module. I've never used it, but it looks like it does basically the same thing. I think it can handle bar-codes too.

Worldlabel.com offers free templates for making labels using OpenOffice.org, the open source office suite.


Back to Karl Fogel's home page.

brought to you by red-bean