Reference

Herein find documentation for the gory details of nominally.

API

nominally.api.parse_name(s: str) dict[str, Any][source]

Parse into Name, return core name attributes as a dic

This is the simplest function interface to nominally.

nominally.api.cli(arguments: Sequence[str] | None = None) int[source]

Simple CLI with a minimal set of options.

  1. Report of a single name (parse into details).

  2. Help via usage information. [help, -h, –help]

  3. Version information. [-V, –version]

nominally.api.cli_help() int[source]

Output help for command line usage

nominally.api.cli_report(raw_name: str, *, details: bool = True) int[source]

Parse into Name, output (core or report) attributes.

nominally.api.cli_version() int[source]

Output version info and script location

Name

class nominally.parser.Name(raw: str = '', *, skip_cleaning: bool = False, prefixes: Collection[str] | None = None)[source]

A personal name, separated and simplified into component parts.

prefixes: Collection[str]
detail: dict[str, List[str]]
classmethod clean(s: str, *, condense: bool = False, final: bool = False) str[source]

Clean this string to the simplest possible representation (but no simpler).

Note

Assumes that any nicknames have already been removed, along with anything else that would depend on special characters (other than commas).

static strip_pointlessness(s: str) str[source]
__eq__(other: object) bool[source]

If Name is parsable and object dicts are identical, consider it equal.

__str__() str[source]

Output format: “last, title first middle suffix (nickname)”

  • “organs, mr harry x, jr (snapper)”

  • “organs, mr harry x, jr”

  • “organs, mr harry x”

  • “organs, harry x”

  • “organs, harry”

  • etc.

property parsable: bool

Return true if any valid name values were created.

title
first
middle
last
suffix
nickname
property raw: str

Return the original input string.

property cleaned: set[str]

Return some set of cleaned string parts.

report() dict[str, Any][source]

Return a more-or-less complete parsing dict.