alterlab-labarchive

Installation
SKILL.md

LabArchives Integration

Overview

LabArchives is an electronic lab notebook platform for research documentation and data management. Its REST API (XML responses, HMAC-signed requests) exposes notebooks, the page tree, entries, attachments, and backups. The core job here needs no account: write and review the integration, draft entry content, and audit a notebook the user has exported. Only live notebook access uses their credentials.

Keyless Path (default — no LabArchives account)

  1. Write and review the integration code against the real clients — labapi (maintained; uv run --with "labapi[dotenv]" python ...) or the git-only labarchives-py the bundled scripts use. Check method names rather than guessing: in labapi 1.2.0 (verified 2026-10-22) a notebook has .export(dest, source="auto"|"walk"|"backup") and .backup(dest, include_attachments=, as_json=), entries are created with page.entries.create(TextEntry, html) / create(AttachmentEntry, Attachment.from_file(...)), and the client reads API_URL/ACCESS_KEYID/ACCESS_PWD from the environment.
  2. Know the signing before you run it. Requests are signed sig = b64(HMAC(access_password, akid + method + expires)), expires in epoch-ms. The two clients differ on the hash — labapi uses HMAC-SHA512, the git labarchives-py wrapper uses HMAC-SHA1 — so the signature must be tested against the tenant, not assumed; match the client to what your institution's API expects.
  3. Audit an exported notebook offline. labapi's notebook.export(dest) writes a folder mirror (<order>_<name>/ directories holding NN_text.html, NN_text.txt, NN_<filename>). python3 scripts/analyze_export.py <dir> walks that tree (or any same-shape export/backup) with no credentials and reports pages, text vs attachment entries, word counts, attachment types, and provenance gaps — pages that hold raw-data attachments with no text entry describing them.
  4. Draft entry content and upload plans offline — the rich-text HTML for add_entry, the caption/provenance note for an attachment, the page-tree layout — ready to push once the user supplies credentials.
  5. Hand over the live step. The bundled scripts (notebook_operations.py, entry_operations.py) read config.yaml and exit non-zero with a clear message if it is absent; they run only against the user's own notebook. Without credentials, stop at the validated code and the offline audit — never invent notebook contents.

When to Use This Skill

Installs
67
GitHub Stars
86
First Seen
Apr 12, 2026