nexusLIMS.db package¶
-
nexusLIMS.db.make_db_query(query)[source]¶ Execute an arbitrary query on the NexusLIMS database and return the results as a list
Submodules¶
nexusLIMS.db.session_handler module¶
-
class
nexusLIMS.db.session_handler.Session(session_identifier, instrument, dt_from, dt_to, user)[source]¶ Bases:
objectA record of an individual session as read from the Nexus Microscopy facility session database. Created by combining two
SessionLogobjects with status"TO_BE_BUILT".- Parameters:
session_identifier (str) -- The UUIDv4 identifier for an individual session on an instrument
instrument (Instrument) -- An object representing the instrument associated with this session
dt_from (
datetime) -- Adatetimeobject representing the start of this sessiondt_to (
datetime) -- Adatetimeobject representing the end of this sessionuser (str) -- The username associated with this session (may not be trustworthy)
-
insert_record_generation_event()[source]¶ Insert a log for this sesssion into the session database with
event_type"RECORD_GENERATION"- Returns:
success -- Whether or not the update operation was successful
- Return type:
-
class
nexusLIMS.db.session_handler.SessionLog(session_identifier, instrument, timestamp, event_type, user)[source]¶ Bases:
objectA simple mapping of one row in the
session_logtable of the NexusLIMS database (all values are strings)- Parameters:
session_identifier (str) -- A UUID4 (36-character string) that is consistent among a single record's "START", "END", and "RECORD_GENERATION" events
instrument (str) -- The instrument associated with this session (foreign key reference to the
instrumentstable)timestamp (str) -- The ISO format timestamp representing the date and time of the logged event
event_type (str) -- The type of log for this session (either "START", "END", or "RECORD_GENERATION")
user (str) -- The NIST "short style" username associated with this session (if known)
