nexusLIMS.extractors.plugins.basic_metadata#

Basic metadata extractor plugin (fallback for unknown file types).

Module Contents#

Classes#

BasicFileInfoExtractor

Fallback extractor for files without a specific format handler.

Functions#

get_basic_metadata

Get basic metadata from a file.

API#

class nexusLIMS.extractors.plugins.basic_metadata.BasicFileInfoExtractor[source]#

Fallback extractor for files without a specific format handler.

This extractor provides basic metadata (creation time, file size, etc.) for files that don’t have a specialized extractor. It has the lowest priority and will only be used if no other extractor supports the file.

name#

‘basic_file_info_extractor’

priority#

0

supported_extensions#

Type: typing.ClassVar

supports(context: ExtractionContext) bool[source]#

Check if this extractor supports the given file.

This extractor always returns True since it’s the fallback for all files.

Parameters:

context – The extraction context containing file information

Returns:

Always True (this is the fallback extractor)

Return type:

bool

extract(context: ExtractionContext) list[dict[str, Any]][source]#

Extract basic metadata from any file.

Provides minimal metadata such as modification time and instrument ID for files that don’t have a specialized extractor.

Parameters:

context – The extraction context containing file information

Returns:

List containing a single metadata dict with ‘nx_meta’ key

Return type:

list[dict]

nexusLIMS.extractors.plugins.basic_metadata.get_basic_metadata(filename)[source]#

Get basic metadata from a file.

Returns basic metadata from a file that’s not currently interpretable by NexusLIMS.

Deprecated since version This: function is deprecated. Use BasicFileInfoExtractor class instead.

Parameters:

filename (Path) – path to a file saved in the harvested directory of the instrument

Returns:

mdict – A description of the file in lieu of any metadata extracted from it.

Return type:

dict