apptools.naming.unique_name module

A re-usable method for calculating a unique name given a list of existing names.

apptools.naming.unique_name.make_unique_name(base, existing=[], format='%s_%s')[source]

Return a name, unique within a context, based on the specified name.

base: the desired base name of the generated unique name. existing: a sequence of the existing names to avoid returning. format: a formatting specification for how the name is made unique.