nexusLIMS.exporters.destinations.labarchives#

LabArchives export destination plugin.

Exports NexusLIMS XML records to a LabArchives electronic lab notebook by creating a page per session with an HTML summary entry and the full XML record attached as a file.

Module Contents#

Classes#

LabArchivesDestination

LabArchives export destination plugin.

API#

class nexusLIMS.exporters.destinations.labarchives.LabArchivesDestination[source]#

LabArchives export destination plugin.

Uploads NexusLIMS XML records to a LabArchives instance. For each session, creates a page under NexusLIMS Records/{instrument}/ in the configured notebook (or the user’s Inbox if no notebook is configured) with:

  • An HTML-formatted session summary as a text entry

  • The full XML record attached as a file

Variables:
  • name (str) – Destination identifier: “labarchives”

  • priority (int) – Export priority: 90 (runs after CDCS at 100, allowing access to CDCS URLs)

name#

‘labarchives’

priority#

90

property enabled: bool#

Check if LabArchives is configured and enabled.

Returns:

True if NX_LABARCHIVES_ACCESS_KEY_ID, NX_LABARCHIVES_ACCESS_PASSWORD, NX_LABARCHIVES_USER_ID, and NX_LABARCHIVES_URL are all configured.

Return type:

bool

validate_config() tuple[bool, str | None][source]#

Validate LabArchives configuration.

Checks that required fields are present and tests authentication by making a lightweight API call.

Returns:

(is_valid, error_message)error_message is None on success.

Return type:

tuple[bool, str | None]

export(context: ExportContext) ExportResult[source]#

Export record to LabArchives.

Creates a notebook page with an HTML summary entry and attaches the XML record file. Never raises exceptions — all errors are caught and returned as ExportResult with success=False.

Parameters:

context (ExportContext) – Export context with file path, session metadata, and results from higher-priority destinations (e.g., CDCS).

Returns:

Result of the export attempt.

Return type:

ExportResult