pynetdicom.utils.set_ae

pynetdicom.utils.set_ae(value: str | None, name: str, allow_empty: bool = True, allow_none: bool = True) str | None[source]

Convert value to an AE like parameter and apply validation.

Parameters:
  • value (str or None) – The value to be converted.

  • name (str) – The name of the parameter being converted.

  • allow_empty (bool, optional) – If True (default) skip validation when an empty string or None is used.

Returns:

If allow_empty is True then may return None, otherwise the string will be returned.

Return type:

str or None