Skip to content

_fqn.py

Object references to fully qualified names (FQNs) conversion utilities.

Object references are represented as strings in the format "module:name", while fully qualified names (FQNs) are represented as tuples of the form (module, name).

FQN

Bases: NamedTuple

ref property

Get the string representation of the fully qualified name (FQN).

Returns:

Type Description
ObjectRef

A string in the format "module:name".

from_ref(ref) classmethod

Create an FQN from a string representation.

Parameters:

Name Type Description Default
ref ObjectRef

A string in the format "module:name".

required

Returns:

Type Description
FQN

A tuple representing the fully qualified name (module, name).

fqn_to_object_ref(fqn)

Convert a fully qualified name (FQN) to a string representation.

Parameters:

Name Type Description Default
fqn tuple[ModuleName, ObjectName]

A tuple representing the fully qualified name (module, name).

required

Returns:

Type Description
ObjectRef

A string in the format "module:name".

object_ref_to_fqn(ref)

Convert a string representation to a fully qualified name (FQN).

Parameters:

Name Type Description Default
ref ObjectRef

A string in the format "module:name".

required

Returns:

Type Description
tuple[ModuleName, ObjectName]

A tuple representing the fully qualified name (module, name).

Raises:

Type Description
ValueError

If the input string is not in the expected format.