extended_data.inputs.decorators¶
Decorator-based input handling for InputProvider consumers.
This module provides two decorators:
@directed_inputs- class decorator that wires InputProvider style input loading (environment variables, stdin, explicit mappings) into plain Python classes without requiring inheritance.@input_config- method decorator that allows fine-grained control over how individual parameters are resolved from the input context (renaming, decoding, required flags, etc.).
The decorated classes automatically receive lazily-evaluated input contexts and runtime metadata that can be consumed by other packages (e.g. python-terraform-bridge) to instantiate the classes safely.
Module Contents¶
Classes¶
Configuration for resolving a single method parameter from inputs. |
|
Metadata exposed on decorated classes for runtime integrations. |
|
Lightweight wrapper around InputProvider instantiation. |
Functions¶
Configure how a method parameter is populated from inputs. |
|
Class decorator that injects InputProvider behavior. |
|
Inject helper properties/methods for interacting with the context. |
|
Wrap instance methods so missing parameters are auto-populated. |
|
Determine whether an attribute should be wrapped. |
Data¶
API¶
- extended_data.inputs.decorators._MISSING = 'object(...)'¶
- extended_data.inputs.decorators._CONFIG_KWARG = '_input_provider_config'¶
- extended_data.inputs.decorators._RUNTIME_LOGGING_KWARG = '_input_provider_runtime_logging'¶
- extended_data.inputs.decorators._RUNTIME_SETTINGS_KWARG = '_input_provider_runtime_settings'¶
- extended_data.inputs.decorators._ERR_CONTEXT_NOT_INITIALIZED = 'directed_inputs decorator not initialized on this instance'¶
- extended_data.inputs.decorators._ERR_CONTEXT_MISSING = 'directed_inputs context missing on instance'¶
- class extended_data.inputs.decorators.InputConfig¶
Configuration for resolving a single method parameter from inputs.
- resolve(provider: extended_data.inputs.__main__.InputProvider) Any | object¶
Resolve a value from the provided InputProvider instance.
- class extended_data.inputs.decorators.InputProviderMetadata¶
Metadata exposed on decorated classes for runtime integrations.
- options: extended_data.containers.ExtendedDict = 'field(...)'¶
- class extended_data.inputs.decorators.InputContext(*, inputs: collections.abc.Mapping[str, Any] | None = None, from_environment: bool = True, from_stdin: bool = False, env_prefix: str | None = None, strip_env_prefix: bool = False)¶
Lightweight wrapper around InputProvider instantiation.
Initialization
- property options: extended_data.containers.ExtendedDict¶
Current configuration (copy) used for instantiation.
- resolve(config: extended_data.inputs.decorators.InputConfig) Any | object¶
Resolve a parameter value using the provided configuration.
- property input_provider: extended_data.inputs.__main__.InputProvider¶
Return the lazily-instantiated InputProvider instance.
- _ensure_instance() extended_data.inputs.__main__.InputProvider¶
- extended_data.inputs.decorators.input_config(parameter_name: str, **config_kwargs: Any) collections.abc.Callable[[collections.abc.Callable[..., Any]], collections.abc.Callable[..., Any]]¶
Configure how a method parameter is populated from inputs.
- extended_data.inputs.decorators.directed_inputs(*, inputs: collections.abc.Mapping[str, Any] | None = None, from_environment: bool = True, from_stdin: bool = False, env_prefix: str | None = None, strip_env_prefix: bool = False) collections.abc.Callable[[type[Any]], type[Any]]¶
Class decorator that injects InputProvider behavior.
- extended_data.inputs.decorators._inject_proxies(cls: type[Any]) None¶
Inject helper properties/methods for interacting with the context.