Skip to content
No description, website, or topics provided.
Go Roff
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/petname * cmd/petname/main.go, petname.go: Apr 10, 2017
debian opening 2.11 Jun 13, 2019
LICENSE * LICENSE: Dec 16, 2014 - refer to Jun 13, 2019
golang-petname.1 * debian/golang-petname.install, golang-petname.1: Dec 16, 2014



petname − an RFC1178 implementation to generate pronounceable, sometimes even memorable, "pet names", consisting of a random combination of adverbs, an adjective, and an animal name


  • Complete version:
usage: petname [-w|--words INT] [-l|--letters INT] [-s|--separator STR] [-d|--dir STR] [-c|--complexity INT] [-u|--ubuntu]
  • Python version:
usage: petname [-h] [-w WORDS] [-l LETTERS] [-s SEPARATOR]


  • -w|--words number of words in the name, default is 2,
  • -l|--letters maximum number of letters in each word, default is unlimited,
  • -s|--separator string used to separate name words, default is '-',
  • -d|--dir directory containing adverbs.txt, adjectives.txt, names.txt, default is /usr/share/petname/,
  • -c|--complexity [0, 1, 2]; 0 = easy words, 1 = standard words, 2 = complex words, default=1,
  • -u|--ubuntu generate ubuntu-style names, alliteration of first character of each word.


This utility will generate "pet names", consisting of a random combination of an adverb, adjective, and an animal name. These are useful for unique hostnames or container names, for instance.

As such, PetName tries to follow the tenets of Zooko’s triangle. Names are:

  • human meaningful
  • decentralized
  • secure

Besides this shell utility, there are also native libraries: python-petname, python3-petname, and golang-petname. Here are some programmatic examples in code:


$ petname

$ petname --words 1

$ petname --words 3

$ petname --words 4

$ petname --separator ":"

$ petname --separator "" --words 3

$ petname --ubuntu

$ petname --complexity 0


Besides this shell utility, there are also native libraries: python-petname, python3-petname, and golang-petname. Here are some programmatic examples in code:

Golang Example

Install it with apt:

$ sudo apt-get install golang-petname

Or here's an example in golang code:

package main

import (

var (
        words = flag.Int("words", 2, "The number of words in the pet name")
        separator = flag.String("separator", "-", "The separator between words in the pet name")

func init() {

func main() {
        fmt.Println(petname.Generate(*words, *separator))

Python Example

See: on pypi.

Install it with pip:

$ [sudo] pip install petname
import argparse
import petname
import sys

parser = argparse.ArgumentParser(description='Generate human readable random names')
parser.add_argument('-w', '--words', help='Number of words in name, default=2', default=2)
parser.add_argument('-l', '--letters', help='Maximum number of letters per word, default=6', default=6)
parser.add_argument('-s', '--separator', help='Separator between words, default="-"', default="-")
parser.options = parser.parse_args()
sys.stdout.write(petname.Generate(int(parser.options.words), parser.options.separator, int(parser.options.letters)) + "\n")


This manpage and the utility were written by Dustin Kirkland <> for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document and the utility under the terms of the Apache2 License.

The complete text of the Apache2 License can be found in /usr/share/common-licenses/Apache-2.0 on Debian/Ubuntu systems.

You can’t perform that action at this time.