IDictionary#

class carb.dictionary.IDictionary#

Bases: pybind11_object

Dictionary interface for hierarchical key/value data.

Methods

__init__(*args, **kwargs)

create_item(self, arg0, arg1, arg2)

Creates or returns an item at the given path under the optional parent.

destroy_item(self, arg0)

Destroys the given item.

get(self, base_item[, path])

Gets a Python object representation for the item at path.

get_array_length(self, arg0)

Gets the array length for an array-typed item.

get_as_bool(self, arg0)

Returns the value as bool.

get_as_float(self, arg0)

Returns the value as float.

get_as_int(self, arg0)

Returns the value as int.

get_as_string(self, base_item[, path])

Returns the string value for an item at path relative to base_item.

get_dict_copy(self, base_item[, path])

Creates python object from the supplied dictionary at path (supplied item is unchanged).

get_item(self, base_item[, path])

Gets a child item by path relative to a base item.

get_item_child_by_index(self, arg0, arg1)

Gets a child by index (0-based).

get_item_child_by_index_mutable(self, arg0, arg1)

Gets a mutable child by index (0-based).

get_item_child_count(self, arg0)

Returns the number of children for an item.

get_item_mutable(self, base_item[, path])

Gets a mutable child item by path relative to a base item.

get_item_name(self, base_item[, path])

Gets the key name for an item at path relative to base_item.

get_item_parent(self, arg0)

Gets the parent item.

get_item_parent_mutable(self, arg0)

Gets the parent item (mutable).

get_item_type(self, arg0)

Returns the ItemType for the given item.

get_preferred_array_type(self, arg0)

Gets the preferred array element ItemType.

is_accessible_as(self, arg0, arg1)

Checks if an item can be accessed as a type.

is_accessible_as_array_of(self, arg0, arg1)

Checks if an item is accessible as an array of a type.

readLock(self, arg0)

Acquires a shared read lock for the item.

set(self, item, path, value)

Sets a value at path from a Python object.

set_bool(self, arg0, arg1)

Sets the value as bool.

set_bool_array(self, arg0, arg1)

Sets an array of booleans.

set_float(self, arg0, arg1)

Sets the value as float.

set_float_array(self, arg0, arg1)

Sets an array of floats.

set_int(self, arg0, arg1)

Sets the value as int.

set_int_array(self, arg0, arg1)

Sets an array of integers.

set_string(self, arg0, arg1)

Sets the string value for an item.

set_string_array(self, arg0, arg1)

Sets an array of strings.

unlock(self, arg0)

Releases a previously acquired read/write lock.

update(self, arg0, arg1, arg2, arg3, arg4)

Merges source subtree into destination.

writeLock(self, arg0)

Acquires an exclusive write lock for the item.

__init__(*args, **kwargs)#
create_item(
self: carb.dictionary._dictionary.IDictionary,
arg0: object,
arg1: str,
arg2: carb.dictionary._dictionary.ItemType,
) carb.dictionary._dictionary.Item#

Creates or returns an item at the given path under the optional parent.

destroy_item(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) None#

Destroys the given item.

get(
self: carb.dictionary._dictionary.IDictionary,
base_item: carb.dictionary._dictionary.Item,
path: str = '',
) object#

Gets a Python object representation for the item at path.

get_array_length(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) int#

Gets the array length for an array-typed item.

get_as_bool(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) bool#

Returns the value as bool.

Zero/empty are False; non-zero/true-like strings are True; dictionaries are False.

get_as_float(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) float#

Returns the value as float.

Converts from other numeric types or from a numeric string when possible.

get_as_int(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) int#

Returns the value as int.

Converts from other numeric types or from a numeric string when possible. Strings outside int64 range may clamp.

get_as_string(
self: carb.dictionary._dictionary.IDictionary,
base_item: carb.dictionary._dictionary.Item,
path: str = '',
) str#

Returns the string value for an item at path relative to base_item.

get_dict_copy(
self: carb.dictionary._dictionary.IDictionary,
base_item: carb.dictionary._dictionary.Item,
path: str = '',
) object#

Creates python object from the supplied dictionary at path (supplied item is unchanged). Item is calculated via the path relative to the base item.

Parameters:
  • base_item – The base item.

  • path – Path, relative to the base item - to the item

Returns:

Python object with copies of the item data.

get_item(
self: carb.dictionary._dictionary.IDictionary,
base_item: carb.dictionary._dictionary.Item,
path: str = '',
) carb.dictionary._dictionary.Item#

Gets a child item by path relative to a base item.

Parameters:
  • base_item – The base dictionary item.

  • path – Relative path to the desired child (’’ for base).

Returns:

Item or None.

get_item_child_by_index(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
arg1: int,
) carb.dictionary._dictionary.Item#

Gets a child by index (0-based). Returns Item or None.

get_item_child_by_index_mutable(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
arg1: int,
) carb.dictionary._dictionary.Item#

Gets a mutable child by index (0-based). Returns Item or None.

get_item_child_count(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) int#

Returns the number of children for an item.

get_item_mutable(
self: carb.dictionary._dictionary.IDictionary,
base_item: carb.dictionary._dictionary.Item,
path: str = '',
) carb.dictionary._dictionary.Item#

Gets a mutable child item by path relative to a base item.

get_item_name(
self: carb.dictionary._dictionary.IDictionary,
base_item: carb.dictionary._dictionary.Item,
path: str = '',
) str#

Gets the key name for an item at path relative to base_item.

get_item_parent(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) carb.dictionary._dictionary.Item#

Gets the parent item. Returns Item or None.

get_item_parent_mutable(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) carb.dictionary._dictionary.Item#

Gets the parent item (mutable). Returns Item or None.

get_item_type(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) carb.dictionary._dictionary.ItemType#

Returns the ItemType for the given item.

get_preferred_array_type(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) carb.dictionary._dictionary.ItemType#

Gets the preferred array element ItemType.

is_accessible_as(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.ItemType,
arg1: carb.dictionary._dictionary.Item,
) bool#

Checks if an item can be accessed as a type.

is_accessible_as_array_of(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.ItemType,
arg1: carb.dictionary._dictionary.Item,
) bool#

Checks if an item is accessible as an array of a type.

readLock(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) None#

Acquires a shared read lock for the item.

When finished, unlock with unlock().

set(
self: carb.dictionary._dictionary.IDictionary,
item: carb.dictionary._dictionary.Item,
path: str = '',
value: handle,
) None#

Sets a value at path from a Python object.

set_bool(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
arg1: bool,
) None#

Sets the value as bool.

If an item exists, its type becomes BOOL; dictionary items lose their children.

set_bool_array(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
arg1: List[bool],
) None#

Sets an array of booleans.

set_float(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
arg1: float,
) None#

Sets the value as float.

If an item exists, its type becomes FLOAT; dictionary items lose their children.

set_float_array(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
arg1: List[float],
) None#

Sets an array of floats.

set_int(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
arg1: int,
) None#

Sets the value as int.

If an item exists, its type becomes INT; dictionary items lose their children.

set_int_array(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
arg1: List[int],
) None#

Sets an array of integers.

set_string(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
arg1: str,
) None#

Sets the string value for an item.

set_string_array(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
arg1: List[str],
) None#

Sets an array of strings.

unlock(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) None#

Releases a previously acquired read/write lock.

update(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
arg1: str,
arg2: carb.dictionary._dictionary.Item,
arg3: str,
arg4: object,
) None#

Merges source subtree into destination.

Parameters:
  • dst_item – Destination base item (or None for root).

  • dst_path – Relative path under dst_item.

  • src_item – Source base item.

  • src_path – Relative path under src_item.

  • update_policy – dictionary.UpdateAction or callable controlling merge behavior.

Notes

  • Destination-only items remain unchanged.

  • If the destination path doesn’t exist, it is created.

  • Merge behavior is decided per-item by the callback or action.

writeLock(
self: carb.dictionary._dictionary.IDictionary,
arg0: carb.dictionary._dictionary.Item,
) None#

Acquires an exclusive write lock for the item.

When finished, unlock with unlock().