Skip to main content

py_get_attrs

No overview available.

def py_get_attrs(
obj: object
) - > dict

Retrieves a dictionary of all public attributes and their current values from a given Python object. This is typically used for serializing object state or inspecting instance data while excluding private or protected members.

Parameters

NameTypeDescription
objobjectThe Python object instance from which to extract public attributes.

Returns

TypeDescription
dictA dictionary mapping attribute name strings to their corresponding values from the object.