nexusLIMS.extractors.plugins.profiles#

Instrument profile modules for customizing extraction behavior.

This package contains instrument-specific profiles that customize metadata extraction without modifying core extractor code. Profiles are automatically discovered and registered during plugin initialization.

Each profile module should:

  1. Import InstrumentProfile and get_profile_registry

  2. Define parser/transformation functions

  3. Create an InstrumentProfile instance

  4. Register it via get_profile_registry().register()

Profile modules are loaded automatically - just add a new .py file to this directory and it will be discovered during plugin initialization.

Examples:

Creating a new instrument profile (in profiles/my_instrument.py):

>>> from nexusLIMS.extractors.base import InstrumentProfile
>>> from nexusLIMS.extractors.profiles import get_profile_registry
>>>
>>> def custom_parser(metadata: dict, context) -> dict:
...     # Custom parsing logic
...     return metadata
>>>
>>> my_profile = InstrumentProfile(
...     instrument_id="My-Instrument-12345",
...     parsers={"custom": custom_parser},
... )
>>> get_profile_registry().register(my_profile)

Submodules#

Package Contents#

Functions#

register_all_profiles

Auto-discover and register all instrument profiles.

API#

nexusLIMS.extractors.plugins.profiles.register_all_profiles() None[source]#

Auto-discover and register all instrument profiles.

Loads profiles from two sources:

  1. Built-in profiles (nexusLIMS/extractors/plugins/profiles/)

  2. Local profiles (from NX_LOCAL_PROFILES_PATH env var, if set)

Each profile module should register itself by calling get_profile_registry().register() at module level.

This function is called automatically during extractor plugin discovery.

Examples:

>>> from nexusLIMS.extractors.plugins.profiles import register_all_profiles
>>> register_all_profiles()
>>> # All built-in and local profiles are now registered