drepr.utils.attr_data#

Classes

AttributeData(steps, current_step_index, ...)

Storing data of an attribute in the same location as in its origin resource.

Container([attrs])

class Container(attrs: Optional[dict[str, drepr.utils.attr_data.AttributeData]] = None)[source]#

Bases: object

Parameters:

attrs (Optional[dict[str, AttributeData]]) –

class AttributeData(steps: list[Union[drepr.models.path.RangeExpr, drepr.models.path.IndexExpr, drepr.models.path.SetIndexExpr, drepr.models.path.WildcardExpr]], current_step_index: int, value_step_index: int, value: dict[int | str, drepr.utils.attr_data.AttributeData | Any])[source]#

Bases: object

Storing data of an attribute in the same location as in its origin resource.

Since we cannot pre-populate the size of the attribute data, it has to built dynamically, so we need to store the data metadata along for rebuilding

Parameters:
steps: list[Union[drepr.models.path.RangeExpr, drepr.models.path.IndexExpr, drepr.models.path.SetIndexExpr, drepr.models.path.WildcardExpr]]#
current_step_index: int#
value_step_index: int#
value: dict[int | str, drepr.utils.attr_data.AttributeData | Any]#
static from_raw_path(raw_path: list)[source]#
Parameters:

raw_path (list) –

static from_path(steps: list[Union[drepr.models.path.RangeExpr, drepr.models.path.IndexExpr, drepr.models.path.SetIndexExpr, drepr.models.path.WildcardExpr]], idx: int = 0)[source]#
Parameters: