Skip to main content

petname

Name

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

Synopsis

  • 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]

Options

  • -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.

Description

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:

Examples

$ petname
wiggly-yellowtail

$ petname --words 1
robin

$ petname --words 3
primly-lasting-toucan

$ petname --words 4
angrily-impatiently-sage-longhorn

$ petname --separator ":"
cool:gobbler

$ petname --separator "" --words 3
comparablyheartylionfish

$ petname --ubuntu
amazed-asp

$ petname --complexity 0
massive-colt

Code

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 (
        "flag"
        "fmt"
        "math/rand"
        "time"
        "github.com/dustinkirkland/golang-petname"
)

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() {
        rand.Seed(time.Now().UTC().UnixNano())
}

func main() {
        flag.Parse()
        rand.Seed(time.Now().UnixNano())
        fmt.Println(petname.Generate(*words, *separator))
}

Python Example

See: on pypi.

Install it with pip:

$ [sudo] pip install petname
#!/usr/bin/python
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")

Author

This manpage and the utility were written by Dustin Kirkland <dustin.kirkland@gmail.com> 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.

Release files for petname 2.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for petname 2.9
File Size Uploaded
petname-2.9.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for petname 2.9
File Interpreter ABI Platform
petname-2.9-py3-none-any.whl Python 3 none any Details

Total release size: 27.0 kB

Release files / petname-2.9.tar.gz

Download URL petname-2.9.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
df4e44b37c7907b5a5e1a74062d56a5845d7efb8833b21b557fdff99afff2d0c
BLAKE2b-256 checksum
How to use checksums
f5748f0b5d5231e9045ef690342aa620e1a2f69d5eff1ec04803fc4fae6fe774
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / petname-2.9-py3-none-any.whl

Download URL petname-2.9-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57f2e0bb4292e9209b5ef02085a33525c638c07f5ec92ebd6db78e8bb574d238
BLAKE2b-256 checksum
How to use checksums
d9d76e9ca18d9d1d73e85be98664cca5d3422873e8838a6cfc84ff2096d9c88c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

2.9 This release

2 release files

2.8

2 release files

2.6

1 release file

2.2

1 release file

2.1

1 release file

2.0

1 release file

1.12

1 release file

1.11

1 release file

1.9

1 release file

1.8

1 release file

1.7

1 release file

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page