Caelum ef3b10d0a9
feat(python): operator CLI with quant smoke gate (4-language parity) (#23)
The Python SDK was the richest but had no operator CLI. Add a stdlib-only one
mirroring the TS 'guardrail' CLI and Go 'guardrailctl':

- python -m guardrail_client <status|regime|smoke|help> [--base URL] [--json]
- 'guardrail' console_scripts entry point in pyproject.toml.
- status: /health + /readiness + /regime summary; regime: regime + inputs.
- smoke: exercises all 9 quant endpoints (ta, fees, sizer, orderbook, pnl,
  correlation, equity/indicators, portfolio/risk, cmc/capabilities) and prints
  a PASS/WARN/FAIL table. Offline-safe everywhere except smoke, which is a gate
  and exits non-zero on failure (EXIT_SMOKE_FAIL=1).

The quant smoke gate now has full parity across all four surfaces: bash
(scripts/smoke_quant.sh), TS CLI, guardrailctl, and python -m guardrail_client.

Docs: Python README gains the quant-method table (incl. orderbook) and a CLI
section.

Verified live (API on 127.0.0.1:8091): py_compile clean; 'smoke' -> all 9 PASS
exit 0; 'status' renders regime/readiness/health; dead-port smoke -> exit 1;
dead-port status -> exit 0 (offline-safe preserved).
2026-06-16 19:56:10 +03:00

11 lines
195 B
Python

"""Module entrypoint so the CLI runs as ``python -m guardrail_client``."""
from __future__ import annotations
import sys
from .cli import main
if __name__ == "__main__":
sys.exit(main())