Skip to main content

Human readable IDs, in Python

Project description

Human ID

A simple library for generating human IDs like look-dead-game-story or get-nice-office-side.

Install with pip install human-id

Usage:

from human_id import generate_id

# Simple: "appear-hard-idea-case"
generate_id()

# Custom separator: "do,past,job,number"
generate_id(separator=",")

# More words: "say-may-ask-traditional-power-week"
generate_id(word_count=10)

# Custom seed - the same UUID will produce the same ID.
import uuid
generate_id(seed=uuid.uuid4())

CLI

This module also comes with a small command line tool: humanid-gen

❯ humanid-gen --help
Usage: humanid-gen [OPTIONS]

  Generate human readable IDs

Options:
  --words INTEGER  Number of words
  --sep TEXT       Separator
  --seed TEXT      Seed to use
  --count INTEGER  Number of IDs to generate
  --help           Show this message and exit.

Implementation

This library contains 100 of the most common English nouns, adjectives and verbs, and will generate a phrase containing several of each type, in the order verb, adjective, noun.

The most common words where chosen because they are typically shorter and simpler to read or type, which is a key property of human readable IDs.

By default the ID will contain 4 words, which means there are 300^4 possible IDs (8,100,000,000). If your use case requires more IDs then you can up the number of words at the expense of the readability factor. To have the same number of possible IDs as UUIDs you require 15 words:

may-hold-come-foreign-low-white-cold-team-point-study-others-home-service-body-child

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

human_id-0.1.0.post2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

human_id-0.1.0.post2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file human_id-0.1.0.post2.tar.gz.

File metadata

  • Download URL: human_id-0.1.0.post2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Darwin/19.4.0

File hashes

Hashes for human_id-0.1.0.post2.tar.gz
Algorithm Hash digest
SHA256 9d5eff2a0148fdc3e7a65cdf6c4f0c339594fc2b41b850afcedd25f491ffb4f8
MD5 d1a60dada5834bc35fd215815eb802fe
BLAKE2b-256 0e4762171edb5339549f21a987d0042f62191a31118d72cbad3de0fc8551af86

See more details on using hashes here.

File details

Details for the file human_id-0.1.0.post2-py3-none-any.whl.

File metadata

  • Download URL: human_id-0.1.0.post2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Darwin/19.4.0

File hashes

Hashes for human_id-0.1.0.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 6a83dfb3b0381d725002cd20357be1a9f39e60e809c82215ff116c390444b591
MD5 af8d54c7d67c45b6d5f50f86e82d6b47
BLAKE2b-256 cc038789a72f06bfbbcbc97052df71b4719fe55488ca0c2b27e25c8d7b86d562

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