haive.core.utils.haive_collectionsΒΆ
from typing import Any Collection utilities for Haive Core.
This module includes advanced collection types and utilities that extend standard Python collections with additional functionality.
ClassesΒΆ
A dictionary that automatically builds keys from object names. |
Module ContentsΒΆ
- class haive.core.utils.haive_collections.NamedDict(/, **data)[source]ΒΆ
Bases:
pydantic.BaseModel
,Generic
[T
],haive.core.utils.getter_mixin.GetterMixin
[T
]A dictionary that automatically builds keys from object names.
This class combines dictionary-like access with attributes extraction and rich lookup capabilities from GetterMixin.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- classmethod convert_input(data)[source]ΒΆ
Process input data into the expected format.
- Parameters:
data (Any)
- Return type:
Any
- get(key, default=None)[source]ΒΆ
Get an item with a default value.
- Parameters:
key (str)
default (Any)
- Return type:
Any
- pop(key, default=None)[source]ΒΆ
Remove and return an item with default value.
- Parameters:
key (str)
default (Any)
- Return type:
Any
- update(items)[source]ΒΆ
Update with dictionary or iterable.
- Parameters:
items (dict[str, T] | collections.abc.Iterable[T]) β Dictionary or iterable of items to add
- Return type:
None
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].