Monkay¶
Monkay provides a safe lifecycle layer for Python modules that need lazy imports, settings evaluation, extension orchestration, and context-local mutable state.
At a Glance¶
- Lazy imports with configurable caching and deprecation warnings
- Settings orchestration with runtime evaluation and temporary overrides
- Extension pipeline with explicit conflict modes (
error,keep,replace) - Context cages for per-task/per-thread state isolation
- ASGI helpers for deterministic startup/shutdown integration
Typical Lifecycle¶
flowchart TD
A["Import module"] --> B["Monkay(...) wires hooks"]
B --> C["Application startup"]
C --> D["evaluate_preloads(...)"]
D --> E["evaluate_settings(...)"]
E --> F["set_instance(...)"]
F --> G["Runtime lazy attribute access"]
Minimal Quickstart¶
Continue in Install and first module.