Skip to content

Home

Here you can read about the api of humid.

humid helps generating human friendly identifiers.

hfid()

Returns a default human friendly identifier.

Returns:

Name Type Description
str str

The human friendly identifier based on elements in ORDER.

Examples:

>>> hfid()
'modest-tarpon-oSYCzJPazgTg94KqiEb392'
Source code in src/humid/core.py
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
def hfid() -> str:
    """Returns a default human friendly identifier.

    Returns:
        str: The human friendly identifier based on elements in `ORDER`.

    Examples:
        >>> hfid()
        'modest-tarpon-oSYCzJPazgTg94KqiEb392'
    """
    selection: list[str] = []
    for words in ORDER:
        selection.append(random.choice(words))

    """Add the identifier string"""
    selection.append(_make_identifier())

    the_id = SEPARATOR.join(selection)

    return the_id