zea.config¶
Config module for managing configuration settings.
This module provides the Config class for managing configuration settings,
with support for loading from YAML files, HuggingFace Hub, and dot notation access.
Features¶
Dot notation access to dictionary keys.
Recursive conversion of nested dictionaries/lists to Config objects.
Attribute access logging and suggestion of similar attribute names.
Freezing/unfreezing to prevent/allow new attributes.
Serialization to YAML/JSON.
Integration with Hugging Face Hub.
Example Usage¶
>>> from zea import Config
>>> # Load from YAML
>>> config = Config.from_path("../configs/config_echonet.yaml")
>>> # Load from HuggingFace Hub
>>> config = Config.from_path("hf://zeahub/configs/config_picmus_rf.yaml")
>>> # Access attributes with dot notation
>>> print(config.data.local)
False
>>> # Update recursively
>>> config.update_recursive({"data": {"local": False}})
>>> # Save to YAML
>>> config.to_yaml("new_config.yaml")
Functions
|
Check a config given dictionary |
Classes
|
Config class. |