heros.helper

Attributes

Functions

__getattr__(name)

Re-export the logging helpers that moved to heros.logging, warning about their deprecation.

object_name_from_keyexpr(key_expr, ns_objects, realm) → str | None

full_classname(o)

Return the fully qualified class name of an object.

get_heros_pkg_versions() → dict

Returns the versions of the installed heros packages

generate_multicast_address(realm) → str

Generate a deterministic multicast address based on the realm name.

Module Contents

heros.helper.log
heros.helper._DEPRECATED_LOGGING_NAMES = ('SPAM', 'Logger', 'ColoredFormatter', 'get_logger')
heros.helper.__getattr__(name: str)[source]

Re-export the logging helpers that moved to heros.logging, warning about their deprecation.

heros.helper.object_name_from_keyexpr(key_expr, ns_objects, realm, endpoint='.*') → str | None[source]
heros.helper.full_classname(o)[source]

Return the fully qualified class name of an object.

Parameters:

o – object

Returns:

fully qualified module and class name

heros.helper.get_heros_pkg_versions() → dict[source]

Returns the versions of the installed heros packages

Returns:

A dictionary with the package names as keys and the versions as values. If package version is not

available, the value is “n.a.”, if package is not installed the value is “not installed”.

Return type:

dict

heros.helper.generate_multicast_address(realm: str) → str[source]

Generate a deterministic multicast address based on the realm name.

Note

As the multicast range does not include an infinite number of ip addresses there is a slim but finite probability that two realm names generate the same multicast address.

Parameters:

realm – The realm name.

Returns:

A multicast IP address in the range 224.0.1.0 to 238.255.255.255.

Return type:

str