Examples¶
This section contains runnable code examples that demonstrate real-world usage of disdantic. Each example is self-contained and demonstrates key architectural features of the library.
[!NOTE] All examples assume you have completed Installation.
Example Categories¶
Polymorphic Messaging
Simple, self-contained example demonstrating core registry capabilities, case-insensitive lookahead routing, and cascading validation schema rebuilding.
Telemetry & Settings
Demonstrates loading configurations from workspace pyproject.toml with strict precedence, default key fallbacks, and structured JSON logging with OpenTelemetry tracing context.
Lazy Loading & Introspection
Showcases deferred loading via thread-safe LazyProxy, SingletonMeta double-checked locking, and recursive, circular-reference-safe runtime self-introspection with InfoMixin.
Auto-Discovery & Diagnostics
Demonstrates automatic package scanning and registration using AutoImporterMixin, programmatic and CLI-based registry diagnostics, and schema exports.
Contributing an Example
Have a useful snippet or pattern to share? See the Contributing Guide to learn how to add a new example to this section.