Item#

class carb.dictionary.Item#

Bases: pybind11_object

Handle to a node in a carb.dictionary tree.

Methods

__init__(*args, **kwargs)

clear(self)

Deletes all children of this item.

get(self, arg0, arg1)

Gets a value or child item by relative path, with a default.

get_dict(self)

Serializes this item (subtree) into a Python object (dict/list/scalar).

get_key_at(self, arg0)

Gets the key name for a child at the given index.

get_keys(self)

Returns a list of child key names.

__init__(*args, **kwargs)#
clear(self: carb.dictionary._dictionary.Item) None#

Deletes all children of this item.

get(
self: carb.dictionary._dictionary.Item,
arg0: str,
arg1: object,
) object#

Gets a value or child item by relative path, with a default.

Parameters:
  • path – Relative path from this item.

  • default – Value to return if the path does not exist.

Returns:

The found Python object or the provided default.

get_dict(self: carb.dictionary._dictionary.Item) object#

Serializes this item (subtree) into a Python object (dict/list/scalar).

get_key_at(
self: carb.dictionary._dictionary.Item,
arg0: int,
) object#

Gets the key name for a child at the given index.

Parameters:

index – Child index (0-based).

Returns:

The key name as str, or None if index is invalid.

get_keys(self: carb.dictionary._dictionary.Item) List[str]#

Returns a list of child key names.