exlab_wizard.lims.schemas#
msgspec.Struct types for the LIMS read-only client. Backend Spec §7.2.
These types model the subset of LIMS data the wizard reads via Mapping B.
The LIMS itself owns project identity; ExLab-Wizard only consumes it. The
LIMSProject struct mirrors the fields documented in §7.2.3 plus a
fetched_at timestamp used by the local SQLite cache for freshness
bookkeeping.
Style:
- kw_only=True on every Struct so callers always specify field names
– the wire-format ordering of LIMS fields is not a stable contract.
forbid_unknown_fields=Falseso that LIMS payload additions in future versions do not break the read path. Unknown fields are silently dropped bymsgspec.json.decode; we re-emit only the fields we know about when writing the offline catalogue.frozen=Falseon LIMSProject because the cache layer mutatesfetched_atwhen re-stamping rows; LIMSUser is frozen since users are read-only.
Classes
|
Result of |
|
One LIMS project row. |
|
One LIMS user row. |
- class exlab_wizard.lims.schemas.HealthStatus(ok, latency_ms, reason=None)[source]#
Bases:
objectResult of
LIMSClient.health_check(). Backend Spec §7.2.3.okis True iff the LIMS responded toGET /mewith 2xx.latency_msis the wall-clock duration in milliseconds (rounded to the nearest int).reasonis None on success and carries a short human-readable failure summary on failure.
- class exlab_wizard.lims.schemas.LIMSProject(*, uid: str, short_id: str, name: str, status: LIMSProjectStatus, owner: str, fetched_at: str, description: str | None = None, contact_name: str | None = None, metadata: dict = <factory>)[source]#
Bases:
StructOne LIMS project row. Backend Spec §7.2.3.
The
metadatafield is a JSONB blob the LIMS owns; ExLab-Wizard does not mutate it.fetched_atis a UTC ISO 8601 timestamp set when the wizard pulled the row – the local cache uses it for freshness bookkeeping (§7.2.4).- status: LIMSProjectStatus#