### Install Concoction using pip Source: https://github.com/soapun/concoction/blob/main/README.md Use this command to install the Concoction library. Ensure you have pip installed. ```bash pip install concoction ``` -------------------------------- ### Define and Inject Service Configuration Block Source: https://github.com/soapun/concoction/blob/main/README.md Define a Pydantic model for the 'app.service' configuration block and load it from a YAML file. This method injects the entire 'service' configuration block. ```python import yaml # pip install pyyaml from pydantic import BaseModel from concoction import Configuration, set_global_config # define config with injection @Configuration("app.service") class ServiceConfig(BaseModel): host: str port: int # Load configuration from a YAML file with open("config.yaml") as f: config = yaml.safe_load(f) set_global_config(config) # Create an instance of the configuration model app_config = ServiceConfig() ``` -------------------------------- ### Inject Individual Service Configuration Fields Source: https://github.com/soapun/concoction/blob/main/README.md Define a Pydantic model to inject individual fields ('host' and 'port') from the 'app.service' configuration path using the Value class. This provides granular control over configuration injection. ```python from concoction.values.pydantic import Value class ServiceConfig(BaseModel): host: str = Value("app.service.host") port: int = Value("app.service.port") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.