11Package entry point for ``oc_diagnostics``. Exports the public runtime API
12so downstream projects can use a single import::
14 from oc_diagnostics import _dbg, init, apply_instrumentation
18- Re-export ``_dbg``, ``DEBUG_LEVELS``, and ``init`` from ``unified_debug``.
19- Re-export ``apply_instrumentation`` from ``instrumentation_middleware`` when
20 Dash is installed; raise an actionable ``ImportError`` at call time when
22- Re-export ``DiagnosticsMiddleware`` from ``fastapi_middleware`` when FastAPI
23 is installed; raise an actionable ``ImportError`` at call time when it is not.
24- Declare ``__all__`` so the public surface is explicit and IDE-discoverable.
25- Remain completely side-effect-free at import time.
32 L3 โ semantic details
37- Must not activate stream interception or exception hooks at import time.
38 Callers must call ``oc_diagnostics.init()`` explicitly.
39- Optional dependencies (Dash, FastAPI) must not be required for import.
40 Missing dependencies must only raise ``ImportError`` at call time.
41- ``__all__`` must list every symbol exported by this module.
46from typing
import Any, NoReturn
48from .unified_debug
import (
64from .logging_handler
import OcDiagnosticsHandler
68 from .instrumentation_middleware
import apply_instrumentation
74 "apply_instrumentation requires Dash. "
75 "Install it with: pip install oc_diagnostics[dash] "
76 "See INTEGRATION_GUIDE.md for setup instructions."
81 from .fastapi_middleware
import DiagnosticsMiddleware
87 "DiagnosticsMiddleware could not be imported. "
88 "Install FastAPI support with: pip install oc_diagnostics[fastapi] "
89 "See INTEGRATION_GUIDE.md ยง10 for setup instructions."
105 "OcDiagnosticsHandler",
106 "apply_instrumentation",
107 "DiagnosticsMiddleware",
NoReturn DiagnosticsMiddleware(*Any args, **Any kwargs)
NoReturn apply_instrumentation(*Any args, **Any kwargs)