heros.helper
============

.. py:module:: heros.helper


Attributes
----------

.. autoapisummary::

   heros.helper.log
   heros.helper._DEPRECATED_LOGGING_NAMES


Functions
---------

.. autoapisummary::

   heros.helper.__getattr__
   heros.helper.object_name_from_keyexpr
   heros.helper.full_classname
   heros.helper.get_heros_pkg_versions
   heros.helper.generate_multicast_address


Module Contents
---------------

.. py:data:: log

.. py:data:: _DEPRECATED_LOGGING_NAMES
   :value: ('SPAM', 'Logger', 'ColoredFormatter', 'get_logger')


.. py:function:: __getattr__(name: str)

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


.. py:function:: object_name_from_keyexpr(key_expr, ns_objects, realm, endpoint='.*') -> str | None

.. py:function:: full_classname(o)

   Return the fully qualified class name of an object.

   :param o: object

   :returns: fully qualified module and class name


.. py:function:: get_heros_pkg_versions() -> dict

   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".
   :rtype: dict


.. py:function:: generate_multicast_address(realm: str) -> str

   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.

   :param realm: The realm name.

   :returns: A multicast IP address in the range 224.0.1.0 to 238.255.255.255.
   :rtype: str


