labthings_fastapi.file_manager

Manage files created by Actions

This module is deprecated in favour of labthings_fastapi.outputs.blob

Simple actions return everything you need to know about them in their return value, which can be serialised to JSON. More complicated actions might need to return more complicated responses, for example files.

The FileManager class is responsible for managing files created by actions. It will handle finding a temporary storage location, and making it possible to retrieve the files via the Invocation object.

Module Contents

Classes

FileManager

Manage files created by Actions

Data

FileManagerDep

API

class labthings_fastapi.file_manager.FileManager(invocation_id: labthings_fastapi.dependencies.invocation.InvocationID, request: fastapi.Request)

Manage files created by Actions

Initialization

__globals__

‘globals(…)’

property directory: str

Return the temporary directory for this invocation

property filenames: list[str]

A list of files currently being managed by this FileManager

Make a file show up in the links of the Invocation

path(filename: str, rel: Optional[str] = None) str

Return the path to a file

Generate links to the files managed by this FileManager

labthings_fastapi.file_manager.FileManagerDep

None