magpie.config ============= .. py:module:: magpie.config Attributes ---------- .. autoapisummary:: magpie.config.SYNC_SERVICES_TYPES magpie.config.SERVICE_TYPE_DICT magpie.config.LOGGER magpie.config.SERVICE_HOOK_ITEM_SCHEMA magpie.config.SERVICE_CONFIG_ITEM_SCHEMA magpie.config.SERVICES_CONFIGURATION_SCHEMA magpie.config.JsonSchemaDefaultValidator Functions --------- .. autoapisummary:: magpie.config.get_logger magpie.config.print_log magpie.config.extend_with_default magpie.config.validate_services_config Module Contents --------------- .. py:data:: SYNC_SERVICES_TYPES :type: Dict[magpie.typedefs.Str, Type[SyncServiceInterface]] .. py:data:: SERVICE_TYPE_DICT .. py:function:: get_logger(name: magpie.typedefs.Str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[magpie.typedefs.Str] = None, datetime_format: Optional[magpie.typedefs.Str] = None) -> logging.Logger Immediately sets the logger level to avoid duplicate log outputs from the `root logger` and `this logger` when `level` is ``logging.NOTSET``. .. py:function:: print_log(msg: magpie.typedefs.Str, logger: Optional[logging.Logger] = None, level: int = logging.INFO, **kwargs: Any) -> None Logs the requested message to the logger and optionally enforce printing to the console according to configuration value defined by ``MAGPIE_LOG_PRINT``. .. py:data:: LOGGER .. py:data:: SERVICE_HOOK_ITEM_SCHEMA .. py:data:: SERVICE_CONFIG_ITEM_SCHEMA .. py:data:: SERVICES_CONFIGURATION_SCHEMA .. py:function:: extend_with_default(validator_class: jsonschema.protocols.Validator) -> jsonschema.protocols.Validator Validator that applies inplace defaults in the instance when provided by the schema. .. py:data:: JsonSchemaDefaultValidator .. py:function:: validate_services_config(services_configuration: magpie.typedefs.JSON) -> magpie.typedefs.ServicesConfig Validate configuration within the ``providers`` section. .. seealso:: :ref:`config_providers` and :ref:`config_file`. :param services_configuration: Service definitions loaded from one or more combined configuration files. :return: Services configuration with validated schema and applied defaults.