:orphan: :mod:`snowmobile.core.cfg.base` =============================== .. py:module:: snowmobile.core.cfg.base .. autoapi-nested-parse:: pydantic Config and Base class for snowmobile.toml and snowmobile-ext.toml objects. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: snowmobile.core.cfg.base.Config snowmobile.core.cfg.base.Base .. class:: Config Configuration class for object model. .. attribute:: extra .. attribute:: allow_population_by_field_name :annotation: = True .. attribute:: allow_population_by_alias :annotation: = True .. attribute:: arbitrary_types_allowed :annotation: = True .. attribute:: json_encoders .. method:: apply_map_by_type(self, attrs: Dict, typ: Any, func: Callable) Recursively apply function to all items of a dictionary of type 'typ'. :param attrs: Dictionary to traverse. :type attrs: dict :param typ: Type of object to apply function to. :type typ: Type :param func: Function to apply to values of type `typ`. :type func: Callable :returns: Altered dictionary with function applied to all keys and values matching `typ`. .. method:: serialize(self, as_dict: Dict) -> Dict Recursively applies `json_encoder` functions to all items of a dictionary. .. class:: Base Bases: :class:`pydantic.BaseModel`, :class:`snowmobile.core.cfg.base.Config` Base class for object model parsed from ``snowmobile.toml``. .. method:: configured_args(self) -> Dict :property: Placeholder for configuration arguments of derived classes. .. method:: kwarg(self, arg_nm: str, arg_val: Any, arg_typ: Any) -> Any Compares a provided keyword argument to a configured keyword argument. .. method:: from_relative(self, obj: Any) Updates current object's attributes with those from a different instance of the same class. .. method:: from_dict(self, args: Dict) Accept a dictionary of arguments and updates the current object as if it were instantiated with those arguments. .. method:: as_serializable(self, by_alias: bool = False) Returns a dictionary in serializable form. .. method:: json(self, by_alias: bool = False, **kwargs) -> str API-facing json serialization method.