pynetdicom.utils.set_ae

pynetdicom.utils.set_ae(value: Optional[str], name: str, allow_empty: bool = True, allow_none: bool = True) Optional[str][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