ncdiff.composer sub-module

class ncdiff.composer.Tag[source]

A set of constants to define common notations of a node tag.

class ncdiff.composer.Composer(device, node)[source]

A base composer class, which is inherited by protocol composer classes, for example: RestconfComposer and gNMIComposer.

device

An instance of yang.ncdiff.ModelDevice, which represents a modeled device.

Type:object
node

A config node or a schema node.

Type:Element
path

A list of ancestors, starting from the root of self.node.

Type:list
model_name

Model name that self.node belongs to.

Type:str
model_ns

Model URL that the root of self.node belongs to.

Type:str
is_config

True if self.node is a config node, False if self.node is a schema node.

Type:bool
schema_node

Coresponding model schema node of self.node if self.node is a config node.

Type:Element
keys

A list of key tags if self.node is type list.

Type:Element

__init__ instantiates a Composer instance.

get_xpath(type, instance=True)[source]

High-level api: Delete four attributes from an Element node if they exist: operation, insert, value and key.

Parameters:element (Element) – The Element node needs to be looked at.
Returns:The Element node is returned after processing.
Return type:Element