ID Property Access (idprop.types)

class idprop.types.IDPropertyArray

An array of values with a fixed type, supporting indexing and slicing.

to_list()

Return the array as a list.

Returns:

The array as a list.

Return type:

list[int] | list[float] | list[bool]

typecode

The type of the data in the array {‘f’: float (32-bit), ‘d’: double (64-bit), ‘i’: int, ‘b’: bool}. Both ‘f’ and ‘d’ use Python’s float type but differ in storage precision.

class idprop.types.IDPropertyGroup

A dictionary-like group of ID properties, supporting key access, iteration, and membership testing.

clear()

Clear all members from this group.

get(key, default=None)

Return the value for key, if it exists, else default.

Parameters:
  • key (str) – The key to look up.

  • default (Any) – Value to return if key is not found.

Returns:

The value for the key, or default if not found.

Return type:

Any

items()

Return a view of the items in the group, behaves like dictionary method items.

Returns:

A view of the items.

Return type:

IDPropertyGroupViewItems

keys()

Return a view of the keys in the group.

Returns:

A view of the keys.

Return type:

IDPropertyGroupViewKeys

pop(key, default)

Remove an item from the group, returning a Python representation.

Raises:

KeyError – When the item doesn’t exist and no default is given.

Parameters:
  • key (str) – Name of item to remove.

  • default (Any) – Value to return when key isn’t found (optional, a KeyError is raised when omitted and the key is not found).

Returns:

A Python representation of the removed item, or default.

Return type:

Any

to_dict()

Return a purely Python version of the group.

Returns:

A dictionary representation of the group.

Return type:

dict[str, Any]

update(other)

Update key-value pairs from other, overwriting existing keys.

Note

Unlike dict.update(), keyword arguments are not supported.

Parameters:

other (IDPropertyGroup | dict[str, Any]) – Updates the values in the group with this.

values()

Return the values associated with this group.

Returns:

A view of the values.

Return type:

IDPropertyGroupViewValues

name

The name of this Group.

class idprop.types.IDPropertyGroupIterItems

Iterator over IDPropertyGroup items (key/value pairs).

class idprop.types.IDPropertyGroupIterKeys

Iterator over IDPropertyGroup keys.

class idprop.types.IDPropertyGroupIterValues

Iterator over IDPropertyGroup values.

class idprop.types.IDPropertyGroupViewItems

A view of IDPropertyGroup items as key/value pairs (supports len(), in, iteration, and reversed()).

class idprop.types.IDPropertyGroupViewKeys

A view of IDPropertyGroup keys (supports len(), in, iteration, and reversed()).

class idprop.types.IDPropertyGroupViewValues

A view of IDPropertyGroup values (supports len(), in, iteration, and reversed()).