class NodeTree(connection: Connection, prefix_hide: Optional[str] = None, list_nodes: Optional[list] = None, preloaded_json: Optional[Dict[str, _NodeInfo]] = None)[source]#

Bases: object

High-level generic lazy node tree.

All interactions with an Zurich Instruments device or a LabOne module happens through manipulating nodes. The NodeTree provides a pythonic way for that.

It reads all available nodes its additional information from the provided connection and makes them available in nested dictionary like interface. The interface also supports accessing the nodes by attribute.

>>> nodetree = NodeTree(connection)
>>> nodetree.example.nodes[8].test

To speed up the initialization time the node tree is initialized lazy. Meaning the dictionary is kept as a flat dictionary and is not converted into a nested one. In addition the nested node objects returned by the NodeTree also are just simple placeholders. Only when performing operations on a node its validity is checked an the calls get translated to the correct node string. (For more information on how to manipulate nodes refer to zhinst.toolkit.nodetree.node.Node).


>>> nodetree = NodeTree(daq)
>>> nodetree.dev123.demods[0].freq
>>> nodetree = NodeTree(daq, prefix_hide = "dev123", list_nodes = ["/dev123/*"])
>>> nodetree.demods[0].freq
  • connection (Connection) – Underlying connection for the node tree. All operations are converted into calls to that connection.

  • prefix_hide (Optional[str]) – Prefix, e.g. device id, that should be hidden in the nodetree. (Hidden means that users do not need to specify it and it will be added automatically to the nodes if necessary) (default = None)

  • list_nodes (Optional[list]) – List of nodes that should be downloaded from the connection. By default all available nodes are downloaded. (default = None)

  • preloaded_json (Optional[Dict[str, _NodeInfo]]) – Optional preloaded node information. (e.g for the HF2 that does not support the listNodesJson function)



Get the node information for a node.


Get the information/data for a node.


Converts a node into a raw node path string.


Converts a raw node path string into a Node object.


Context manager for a transactional set.


Converts a string representation of a node into a raw node path string.


Converts a node into a raw node path string.

update_node(node, updates, *[, add])

Update a node in the NodeTree.

update_nodes(update_dict, *[, add, ...])

Update multiple nodes in the NodeTree.



Underlying connection.


Prefix (e.g device id), that is hidden in the nodetree.


Underlying flat dictionary with all node information.


Transaction manager.