labthings_fastapi.dependencies.metadata

Module Contents

Functions

thing_states_getter

A dependency to retrieve summary metadata from all Things in this server.

Data

GetThingStates

API

labthings_fastapi.dependencies.metadata.thing_states_getter(request: fastapi.Request) Callable[[], collections.abc.Mapping[str, Any]]

A dependency to retrieve summary metadata from all Things in this server.

This is intended to make it easy for a Thing to summarise the other Things it’s associated with, for example it’s used to populate the UserComment EXIF field in the OpenFlexure Microscope.

thing_states_getter differs from get_thing_states because the latter is evaluated once, before the action, and this dependency returns a function that collects the metadata when it’s run.

If your action is likely to be run from other actions where the metadata changes, you should use this version.

labthings_fastapi.dependencies.metadata.GetThingStates

None