RelativePath#

class RelativePath(text)#

Bases: object

An ordered native browse route, parsed or constructed from qualified names.

Parse a browse path using the native parser.

The native parser has a known multi-digit namespace-index limitation. Use from_qualified_names() for structured hierarchical paths.

Parameters:

text (str)

Native relative-path syntax.

Returns:

RelativePath – Parsed ordered path elements.

Examples

>>> path = RelativePath("/Objects/Server")
>>> len(path.elements)
2

Attributes

Methods

from_qualified_names

Construct forward hierarchical steps from qualified browse names.

parse

Parse a browse path, equivalent to the constructor.

elements#
static from_qualified_names(names)#

Construct forward hierarchical steps from qualified browse names.

Parameters:

names (list[QualifiedName])

Names in path order; each step includes hierarchical reference subtypes.

Returns:

RelativePath – The structured native path, without string parsing.

static parse(path_str)#

Parse a browse path, equivalent to the constructor.

Parameters:

path_str (str)

Native relative-path syntax.

Returns:

RelativePath – Parsed ordered path elements.