Skip to main content

labqc-cli

日本語版 README はこちら (README_JA.md)

License: MIT Python 3.9+ Dependencies: Zero Offline First MCP Server

Zero-dependency, offline-first CLI auditor, built-in stdio MCP server, and Agent Skill for wet-lab CSV/TSV datasets, qPCR plates, calibration curves, and Excel gene-name date corruption.

labqc inspects experimental tables locally in milliseconds—using Python standard library only—and provides both an Agent-First CLI (--format json, --quiet, deterministic exit codes 0/1/2), a built-in JSON-RPC 2.0 MCP server (labqc mcp / labqc-mcp), and a single-file HTML report (pure inline SVG charts, zero external CDNs).

labqc-cli preview


Why labqc-cli?

Every wet-lab spreadsheet fails in predictable ways right before manuscript submission or AI pipeline handoff:

  • Excel gene-name date corruption: MARCH1 becomes 1-Mar / March-1 / 3月1日, SEPT2 becomes 2-Sep / Sept-2, DEC1 becomes 1-Dec, and 2310009E13 becomes 2.31E+13.
  • Mixed measurement units: Someone records 0.025 ug/mL in a ng/mL column, or enters a 1,000x prefix slip.
  • Hidden qPCR & calibration issues: Missing NTC controls (QPCR_MISSING_NTC), NTC amplification (Ct < 35), Ct outliers (QPCR_CT_OUTLIER), replicate SD > 0.5 (MIQE threshold), non-monotonic standard curves, or extrapolated unknowns.
  • Silent encoding & delimiter traps: Japanese Excel Shift_JIS / CP932, UTF-8/UTF-16 BOMs, jagged unquoted commas, or duplicate Sample_ID rows.
  • Data governance blocks: You cannot upload unpublished experimental or clinical cohorts to cloud SaaS validators.

labqc runs 100% offline with zero third-party pip dependencies, launches in under 1 second, and never makes any outbound network request.


Quick Start (1-Line Install & Instant Demo)

pip install labqc-cli

Or run directly with uv:

uvx --from labqc-cli labqc demo --format json

Try the synthetic wet-lab demo and generate an HTML report + cleaned CSV:

labqc demo --out demo_report.html --clean-out demo_cleaned.csv

Audit your own experimental file (human report or machine-readable agent JSON):

# Human-readable report + cleaned UTF-8 CSV
labqc audit experiment_results.csv --out qc_report.html --clean-out experiment_clean.csv

# Agent-first JSON audit (writes zero extra HTML files unless --out is passed)
labqc audit experiment_results.csv --format json --strict

Use as an Offline MCP Server (Claude Desktop / Cursor)

labqc-cli v0.2 includes a zero-dependency JSON-RPC 2.0 stdio MCP server (labqc mcp / labqc-mcp) exposing three offline tools:

  • audit_lab_table: Audits CSV/TSV files or inline csv_text for gene-date corruption, mixed units, missingness, IQR/MAD outliers, batch shifts, and formula injection.
  • audit_qpcr_plate: Enforces MIQE plate QC (QPCR_MISSING_NTC, QPCR_NTC_CONTAMINATION, QPCR_CT_OUTLIER, QPCR_INVALID_CT, QPCR_HIGH_REPLICATE_SD).
  • generate_qc_html_report: Writes a self-contained zero-CDN HTML report (with optional UTF-8 cleaned CSV).

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "labqc": {
      "command": "uvx",
      "args": ["--from", "labqc-cli", "labqc-mcp"]
    }
  }
}

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "labqc": {
      "command": "labqc",
      "args": ["mcp"]
    }
  }
}

Agent Skill Package (skills/labqc/SKILL.md)

Ready for Claude Code, Cursor, Antigravity, and skills-hub.ai — copy skills/labqc/ into your workspace or global skills directory (.claude/skills/labqc/ or .gemini/skills/labqc/).


Before & After: What labqc Catches Automatically

Raw Spreadsheet Trap What labqc Detects & Reports Action Taken in --clean-out CSV
1-Mar, March-1, 3月1日, 2-Sep, 2.31E+13 in gene_symbol CRITICAL EXCEL_GENE_DATE_CORRUPTION with suggested symbols (MARCH1/MARCHF1, SEPT2/SEPTIN2, DEC1, OCT4) Never silently guessed/overwritten — preserved intact and tagged in labqc_flags for scientist review
12.5 ng/mL mixed with 0.025 ug/mL CRITICAL MIXED_UNITS across concentration / molarity / mass / volume / time Safely converts 0.025 ug/mL -> 25 ng/mL and logs conversion
#DIV/0!, NA, nd, Undetermined, Inf, NaN Flags non-finite values (NON_FINITE_VALUES) & Excel errors (EXCEL_ERROR_TOKENS) Normalizes missing placeholders to empty cells ("") cleanly
Plate_1 vs Plate_2 shift WARNING BATCH_SHIFT_DETECTED (one-way ANOVA $F$, $\eta^2$, Kruskal–Wallis $H$) Flags batch shift in terminal, JSON, and SVG batch comparison chart
Missing NTC, NTC Ct = 31.4, Ct outlier, replicate SD > 0.5 CRITICAL / WARNING MIQE qPCR alerts (QPCR_MISSING_NTC, QPCR_NTC_CONTAMINATION, QPCR_CT_OUTLIER, QPCR_HIGH_REPLICATE_SD) Highlighted in dedicated qPCR panel and JSON summary
=cmd|'/C calc'!A0 formula strings WARNING CSV_FORMULA_INJECTION Neutralized with leading ' when --neutralize-formulas is enabled
Japanese Excel CP932 / UTF-8 BOM / UTF-16 Auto-detected encoding (cp932, utf-8-sig, utf-16, utf-8, latin-1) Re-encoded safely to portable UTF-8 CSV

Agent-First CLI Usage & Deterministic Exit Codes

labqc audit INPUT [--out REPORT.html] [--clean-out CLEAN.csv] [--json-out AUDIT.json]
                  [--mode auto|general|qpcr|curve] [--id-col COL] [--batch-col COL]
                  [--delimiter DELIM] [--lang en|ja] [--format text|json] [--quiet]
                  [--neutralize-formulas] [--strict]

labqc demo  [--scenario all|qpcr|curve] [--out DEMO.html] [--clean-out CLEAN.csv]
            [--json-out AUDIT.json] [--lang en|ja] [--format text|json] [--quiet]
            [--neutralize-formulas] [--strict]

labqc mcp       # Start JSON-RPC 2.0 stdio MCP server (alias: labqc-mcp)
labqc version   # Print version (--format json supported)

Exit Code Contract

  • 0: Audit completed cleanly (or without CRITICAL blockers when --strict is omitted).
  • 1: Argument, input file, directory collision, or I/O error (all errors emit cause + copy-paste Fix command).
  • 2: One or more CRITICAL findings detected under --strict.

Python API

from pathlib import Path
from labqc import audit_file

report = audit_file(Path("experiment_results.csv"))
print(report.score, report.grade, report.critical_count)

Features Inside Every Single-File HTML Report

  • Quality Scorecard (0–100, Grade A–F): Transparent deduction across structural, statistical, and biological checks.
  • Prioritized Action Checklist: Sorted CRITICAL -> WARNING -> INFO with row numbers, examples, and exact remediation guidance.
  • Pure Inline SVG Visualizations: Missingness bar chart, per-column numeric histograms (with median & 1.5x IQR outlier fences), batch median comparison SVG, and calibration curve scatter + OLS fit SVG.
  • Zero External Requests: Zero JavaScript frameworks, zero Google Fonts, zero external CDNs. Opens cleanly in air-gapped labs and prints cleanly to PDF.
  • Bilingual UI: Supports --lang en (default) and --lang ja.

Development & Running Tests

git clone https://github.com/autotool-lab/labqc-cli.git
cd labqc-cli
uv run --with pytest pytest -v
uv build

Research Use Only (RUO) & License

  • License: MIT License
  • Research Use Only (RUO): labqc-cli is provided strictly for research data quality auditing and statistical education. It is not intended for clinical diagnosis, treatment decisions, patient management, or regulatory (FDA / IVD / GLP / 21 CFR Part 11) validation.

Need a local desktop GUI for flow cytometry, statistics, and publication-ready figures? AutoTool Lab Complete Lab Suite (https://autotool-lab-showcase.kanekiti1125.workers.dev/)

Metadata

Release files for labqc-cli 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for labqc-cli 0.2.0
File Size Uploaded Provenance Actions
labqc_cli-0.2.0.tar.gz 76.9 kB Without provenance Details for labqc_cli-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for labqc-cli 0.2.0
File Interpreter ABI Platform Actions
labqc_cli-0.2.0-py3-none-any.whl Python 3 none any Details for labqc_cli-0.2.0-py3-none-any.whl

Total release size: 137.4 kB

Release files / labqc_cli-0.2.0.tar.gz

Download URL labqc_cli-0.2.0.tar.gz
Size 76.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e59f814334ad2183e2e9ff5dc85c4cbf909675a3029095e73053eb7decbadc6f
BLAKE2b-256 checksum
How to use checksums
bd1691a1fc2a48b09abd454441c116708db9795ac3c6997c3560fb12968d74c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / labqc_cli-0.2.0-py3-none-any.whl

Download URL labqc_cli-0.2.0-py3-none-any.whl
Size 60.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca523a2a0e4f33e847ba8ad7391987366cd9118aa75dac1d244144b7f8754b10
BLAKE2b-256 checksum
How to use checksums
c1498779730cf77b85b08fb3d90d32db30f63e2c23a018091bbd9541b6909762
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for labqc-cli 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page