demessaging.config.api module

DASF API utilties for to access the configuration.

Functions:

configure([js, merge])

Configuration decorator for function or modules.

demessaging.config.api.configure(js: str | None = None, merge: bool = True, **kwargs) Callable[[T], T][source]

Configuration decorator for function or modules.

Use this function as a decorator for classes or functions in the backend module like so:

>>> @configure(field_params={"a": {"gt": 0}}, returns={"gt": 0})
... def sqrt(a: float) -> float:
...     import math
...
...     return math.sqrt(a)

The available parameters for this function vary depending on what you are decorating. If you are decorating a class, your parameters must be valid for the ClassConfig. If you are decorating a function, your parameters must be valid for a FunctionConfig.

Parameters:
  • js (Optional[str]) – A JSON-formatted string that can be used to setup the config.

  • merge (bool) – If True (default), then the configuration will be merged with the existing configuration for the function (if existing)

  • **kwargs – Any keyword argument that can be used to setup the config.

Notes

If you are specifying any kwargs, your first argument (js) should be None.

demessaging.config.api.registry = ApiRegistry(imports={}, objects=[])

registry for the stuff that should be available in the generated client stub