demessaging.config.backend module

Configuration classes for the de-messaging backend module.

Classes:

BaseConfig(*, doc, registry, template[, ...])

Configuration base class for functions, modules and classes.

ClassConfig(*, doc, registry, template[, ...])

Configuration class for a backend module class.

FunctionConfig(*, doc, registry, template[, ...])

Configuration class for a backend module function.

ListenConfig(*, doc, registry, template[, ...])

A configuration for the listen command

ModuleConfig(*, doc, registry, template[, ...])

Configuration class for a backend module.

class demessaging.config.backend.BaseConfig(*, doc: str = '', registry: ~demessaging.config.registry.ApiRegistry = <factory>, template: ~demessaging.template.Template = Template(name='empty', folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/templates'), suffix='.jinja2', context={}))[source]

Bases: BaseModel

Configuration base class for functions, modules and classes.

Parameters:

Attributes:

doc

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

registry

template

Methods:

render(**context)

Generate the code to call this function in the frontend.

doc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

registry: ApiRegistry
render(**context) str[source]

Generate the code to call this function in the frontend.

template: Template
class demessaging.config.backend.ClassConfig(*, doc: str = '', registry: ~demessaging.config.registry.ApiRegistry = <factory>, template: ~demessaging.template.Template = Template(name='class_.py', folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/templates'), suffix='.jinja2', context={}), name: str = '', init_doc: str = '', signature: ~inspect.Signature | None = None, methods: ~typing.List[str] = <factory>, validators: ~typing.Dict[str, ~typing.Any] = <factory>, serializers: ~typing.Dict[str, ~typing.Any] = <factory>, field_params: ~typing.Dict[str, ~typing.Dict[str, ~typing.Any]] = <factory>, annotations: ~typing.Dict[str, ~typing.Any] = <factory>, reporter_args: ~typing.Dict[str, ~deprogressapi.base.BaseReport] = <factory>, json_schema_extra: ~typing.Dict[str, ~typing.Any] = <factory>)[source]

Bases: BaseConfig

Configuration class for a backend module class.

Parameters:
  • doc (str) – The documentation of the object. If empty, this will be taken from the corresponding __doc__ attribute.

  • registry (demessaging.config.registry.ApiRegistry) – Utilities for imports and encoders.

  • template (demessaging.template.Template) – The demessaging.template.Template that is used to render the class for the generated API.

  • name (str) – The name of the function. If empty, this will be taken from the classes __name__ attribute.

  • init_doc (str) – The documentation of the function. If empty, this will be taken from the classes __init__ method.

  • signature (Optional[inspect.Signature]) – The calling signature for the function. If empty, this will be taken from the function itself.

  • methods (List[str]) – methods to use within the backend modules

  • validators (Dict[str, Any]) – custom validators for the constructor parameters

  • serializers (Dict[str, Any]) – A mapping from function argument to serializer that is of instance pydantic.functional_serializers.PlainSerializer or pydantic.functional_serializers.WrapSerializer.

  • field_params (Dict[str, Dict[str, Any]]) – custom Field overrides for the constructor parameters. See pydantic.Fields.Field()

  • annotations (Dict[str, Any]) – custom annotations for constructor parameters

  • reporter_args (Dict[str, deprogressapi.base.BaseReport]) – Arguments that use the dasf-progress-api

  • json_schema_extra (Dict[str, Any]) – Any extra parameter for the JSON schema export for the function

Attributes:

annotations

field_params

init_doc

json_schema_extra

methods

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name

reporter_args

serializers

signature

template

validators

annotations: Dict[str, Any]
doc: str
field_params: Dict[str, Dict[str, Any]]
init_doc: str
json_schema_extra: Dict[str, Any]
methods: List[str]
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
registry: ApiRegistry
reporter_args: Dict[str, BaseReport]
serializers: Dict[str, Any]
signature: inspect.Signature | None
template: Template
validators: Dict[str, Any]
class demessaging.config.backend.FunctionConfig(*, doc: str = '', registry: ~demessaging.config.registry.ApiRegistry = <factory>, template: ~demessaging.template.Template = Template(name='function.py', folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/templates'), suffix='.jinja2', context={}), name: str = '', signature: ~inspect.Signature | None = None, validators: ~typing.Dict[str, ~typing.List[~pydantic.types.ImportString | ~typing.Annotated[~typing.Callable, ~pydantic.functional_serializers.PlainSerializer(func=~demessaging.utils.object_to_string, return_type=PydanticUndefined, when_used=always)]]] = <factory>, serializers: ~typing.Dict[str, ~pydantic.types.ImportString | ~typing.Annotated[~typing.Callable, ~pydantic.functional_serializers.PlainSerializer(func=~demessaging.utils.object_to_string, return_type=PydanticUndefined, when_used=always)]] = <factory>, return_validators: ~typing.List[~pydantic.types.ImportString | ~typing.Annotated[~typing.Callable, ~pydantic.functional_serializers.PlainSerializer(func=~demessaging.utils.object_to_string, return_type=PydanticUndefined, when_used=always)]] | None = None, return_serializer: ~pydantic.types.ImportString | ~typing.Annotated[~typing.Callable, ~pydantic.functional_serializers.PlainSerializer(func=~demessaging.utils.object_to_string, return_type=PydanticUndefined, when_used=always)] | None = None, field_params: ~typing.Dict[str, ~typing.Dict[str, ~typing.Any]] = <factory>, returns: ~typing.Dict[str, ~typing.Any] = <factory>, return_annotation: ~typing.Any | None = None, annotations: ~typing.Dict[str, ~typing.Any] = <factory>, reporter_args: ~typing.Dict[str, ~deprogressapi.base.BaseReport] = <factory>, json_schema_extra: ~typing.Dict[str, ~typing.Any] = <factory>)[source]

Bases: BaseConfig

Configuration class for a backend module function.

Parameters:
  • doc (str) – The documentation of the object. If empty, this will be taken from the corresponding __doc__ attribute.

  • registry (demessaging.config.registry.ApiRegistry) – Utilities for imports and encoders.

  • template (demessaging.template.Template) – The demessaging.template.Template that is used to render the function for the generated API.

  • name (str) – The name of the function. If empty, this will be taken from the functions __name__ attribute.

  • signature (Optional[inspect.Signature]) – The calling signature for the function. If empty, this will be taken from the function itself.

  • validators (Dict[str, List[Union[pydantic.types.ImportString, Annotated[Callable, PlainSerializer(func=<function object_to_string at 0x71be7455feb0>, return_type=PydanticUndefined, when_used='always')]]]]) – Custom validators for function arguments. This parameter is a mapping from function argument name to a list of callables that can be used as validator.

  • serializers (Dict[str, Union[pydantic.types.ImportString, Annotated[Callable, PlainSerializer(func=<function object_to_string at 0x71be7455feb0>, return_type=PydanticUndefined, when_used='always')]]]) – A mapping from function argument to serializing function that is then used for the pydantic.functional_serializers.PlainSerializer.

  • return_validators (Optional[List[Union[pydantic.types.ImportString, Annotated[Callable, PlainSerializer(func=<function object_to_string at 0x71be7455feb0>, return_type=PydanticUndefined, when_used='always')]]]]) – Validators for the return value. This parameter is a list of callables that can be used as validator for the return value.

  • return_serializer (Union[pydantic.types.ImportString, Annotated[Callable, PlainSerializer(func=<function object_to_string at 0x71be7455feb0>, return_type=PydanticUndefined, when_used='always')], NoneType]) – A function that is used to serialize the return value.

  • field_params (Dict[str, Dict[str, Any]]) – custom Field overrides for the constructor parameters. See pydantic.Fields.Field()

  • returns (Dict[str, Any]) – custom returns overrides.

  • return_annotation (Optional[Any]) – The annotation for the return value.

  • annotations (Dict[str, Any]) – custom annotations for function parameters

  • reporter_args (Dict[str, deprogressapi.base.BaseReport]) – Arguments that use the dasf-progress-api

  • json_schema_extra (Dict[str, Any]) – Any extra parameter for the JSON schema export for the function

Attributes:

annotations

field_params

json_schema_extra

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name

reporter_args

return_annotation

return_serializer

return_validators

returns

serializers

signature

template

validators

annotations: Dict[str, Any]
doc: str
field_params: Dict[str, Dict[str, Any]]
json_schema_extra: Dict[str, Any]
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
registry: ApiRegistry
reporter_args: Dict[str, BaseReport]
return_annotation: Any | None
return_serializer: ImportString | Annotated[Callable, PlainSerializer(object_to_string)] | None
return_validators: List[ImportString | Annotated[Callable, PlainSerializer(object_to_string)]] | None
returns: Dict[str, Any]
serializers: Dict[str, ImportString | Annotated[Callable, PlainSerializer(object_to_string)]]
signature: inspect.Signature | None
template: Template
validators: Dict[str, List[ImportString | Annotated[Callable, PlainSerializer(object_to_string)]]]
class demessaging.config.backend.ListenConfig(*, doc: str = '', registry: ~demessaging.config.registry.ApiRegistry = <factory>, template: ~demessaging.template.Template = Template(name='empty', folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/templates'), suffix='.jinja2', context={}), dump_to: str | None = None, dump_tool: str | None = None, cmd: str | None = None)[source]

Bases: BaseConfig

A configuration for the listen command

Parameters:

Attributes:

cmd

dump_to

dump_tool

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

cmd: str | None
doc: str
dump_to: str | None
dump_tool: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

registry: ApiRegistry
template: Template
class demessaging.config.backend.ModuleConfig(*, doc: str = '', registry: ~demessaging.config.registry.ApiRegistry = <factory>, template: ~demessaging.template.Template = Template(name='module.py', folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/templates'), suffix='.jinja2', context={}), messaging_config: ~demessaging.config.messaging.PulsarConfig | ~demessaging.config.messaging.WebsocketURLConfig, listen_config: ~demessaging.config.backend.ListenConfig = <factory>, log_config: ~demessaging.config.logging.LoggingConfig = LoggingConfig(config_file=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/config/logging.yaml'), level=None, logfile=None, config_overrides=None, merge_config=False), debug: bool = False, members: ~typing.List[str | ~typing.Callable | ~typing.Type[object] | ~typing.Any] = <factory>, imports: str = '', json_schema_extra: ~typing.Dict[str, ~typing.Any] = <factory>)[source]

Bases: BaseConfig

Configuration class for a backend module.

Parameters:

Attributes:

debug

imports

json_schema_extra

listen_config

log_config

members

messaging_config

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pulsar_config

DEPRECATED! Get the messaging configuration.

template

debug: bool
doc: str
imports: str
json_schema_extra: Dict[str, Any]
listen_config: ListenConfig
log_config: LoggingConfig
members: List[str | Callable | Type[object] | Any]
messaging_config: PulsarConfig | WebsocketURLConfig
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property pulsar_config: PulsarConfig | WebsocketURLConfig

DEPRECATED! Get the messaging configuration.

Please use the messaging_config attribute of this class.

registry: ApiRegistry
template: Template