Files
stack/src/cli/__init__.py
kert b1e06b1b9e feat(bls): OEWS occupation wages + CES health-care employment — bls.oews / bls.ces, stack bls oews|ces, notebook 7f (refs #695)
OEWS: the BLS API serves only the latest OEWS year, so history comes
from the annual oesm{yy}nat.zip files (2013–2024), which bls.gov only
serves to a full browser header set; each zip's national_M{year}_dl
sheet (xls through 2013, xlsx after; OCC_GROUP through 2018, O_GROUP
plus area/industry columns from 2019) is normalised to one row per SOC
occupation with employment and the hourly/annual wage distribution,
suppressed cells (* # **) as NULL, and the BLS series-id prefix kept
per row. One bib Source per release (module:bls, table:bls.oews,
source:bls-website, year:N) and a cms.ingest_log row with the zip's
sha256.

CES: a closed registry of employment (01) and average hourly earnings
(03) series for health care, ambulatory care, offices of physicians,
home health, hospitals and nursing/residential care (CES65<industry>
<type>), pulled through the public API in 10-year × 25-series chunks
(20 × 50 with BLS_API_KEY), monthly rows with the series id on every
row, one bib Source per series.

stack bls oews [--year]... [--write [--offline]] [--occ]...;
stack bls ces [--write] [--series]... [--annual]. Notebook 7f overlays
clinical-staff wages (31-9092, 29-2061, 29-1141, 29-1171) and
physician-office / ambulatory employment on the family's exposure
dates. CLI docs regenerated.
2026-09-22 16:25:46 -04:00

79 lines
2.5 KiB
Python

"""CLI entry point for the stack platform.
Usage::
uv run stack --help
uv run stack run readmissions
uv run stack load cclf --path data/cclf/
uv run stack bib sync
"""
from __future__ import annotations
import typer
from cli.api import app as api_app
from cli.bib import app as bib_app
from cli.bls import app as bls_app
from cli.comments import app as comments_app
from cli.db import app as db_app
from cli.docs import app as docs_app
from cli.generate import app as generate_app
from cli.health import health
from cli.lake import app as lake_app
from cli.llm import app as llm_app
from cli.load import app as load_app
from cli.mail import app as mail_app
from cli.perf import app as perf_app
from cli.pfs import app as pfs_app
from cli.prisma import app as prisma_app
from cli.rec import app as rec_app
from cli.run import run
from cli.validate import validate
from cli.zot import app as zot_app
app = typer.Typer(
name="stack",
help="Healthcare data platform CLI.",
no_args_is_help=True,
)
app.command()(run)
app.command()(validate)
app.command()(health)
app.add_typer(load_app, name="load", help="Ingest data (CCLF, BCDA, seeds).")
app.add_typer(generate_app, name="generate", help="Regenerate code artefacts.")
app.add_typer(bib_app, name="bib", help="Bibliography operations.")
app.add_typer(
bls_app,
name="bls",
help="BLS occupation wages (OEWS) and health-care employment (CES).",
)
app.add_typer(
comments_app,
name="comments",
help="CMS rulemaking comment text extraction & analysis.",
)
app.add_typer(lake_app, name="lake", help="Lakehouse schema and data.")
app.add_typer(llm_app, name="llm", help="Local RAG — index, search, tag.")
app.add_typer(db_app, name="db", help="DuckDB utilities.")
app.add_typer(docs_app, name="docs", help="Documentation generation.")
app.add_typer(api_app, name="api", help="API server.")
app.add_typer(perf_app, name="perf", help="Pipeline telemetry utilities.")
app.add_typer(
rec_app,
name="rec",
help="Reconcile calculated payments against CMS ground-truth files.",
)
app.add_typer(
pfs_app, name="pfs", help="Code elements, lineage events and derived families."
)
app.add_typer(zot_app, name="zot", help="Zotero database maintenance.")
app.add_typer(prisma_app, name="prisma", help="LLM-driven PRISMA screening workflow.")
app.add_typer(mail_app, name="mail", help="Maddy mail server (DO + Resend smarthost).")
def main() -> None:
"""Entry point for ``uv run stack``."""
app()