extended_data.inputs.decorators

Decorator-based input handling for InputProvider consumers.

This module provides two decorators:

  1. @directed_inputs - class decorator that wires InputProvider style input loading (environment variables, stdin, explicit mappings) into plain Python classes without requiring inheritance.

  2. @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

InputConfig

Configuration for resolving a single method parameter from inputs.

InputProviderMetadata

Metadata exposed on decorated classes for runtime integrations.

InputContext

Lightweight wrapper around InputProvider instantiation.

Functions

input_config

Configure how a method parameter is populated from inputs.

directed_inputs

Class decorator that injects InputProvider behavior.

_inject_proxies

Inject helper properties/methods for interacting with the context.

_wrap_instance_methods

Wrap instance methods so missing parameters are auto-populated.

_should_skip_method

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.

parameter_name: str = None
source_name: str | None = None
required: bool = False
default: Any = None
decode_from_json: bool = False
decode_from_yaml: bool = False
decode_from_base64: bool = False
allow_none: bool = True
as_extended: bool = False
is_bool: bool = False
is_integer: bool = False
is_float: bool = False
is_path: bool = False
is_datetime: bool = False
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

refresh(**overrides: Any) None

Refresh the context with new InputProvider options.

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.

extended_data.inputs.decorators._wrap_instance_methods(cls: type[Any]) None

Wrap instance methods so missing parameters are auto-populated.

extended_data.inputs.decorators._should_skip_method(name: str, attribute: Any) bool

Determine whether an attribute should be wrapped.