taps.data.proxy¶
ProxyFileTransformerConfig ¶
Bases: DataTransformerConfig
Proxy file transformer config.
add_argument_group()
classmethod
¶
add_argument_group(
parser: ArgumentParser,
*,
argv: Sequence[str] | None = None,
required: bool = True
) -> None
Add model fields as arguments of an argument group on the parser.
Parameters:
-
parser(ArgumentParser) –Parser to add a new argument group to.
-
argv(Sequence[str] | None, default:None) –Optional sequence of string arguments.
-
required(bool, default:True) –Mark arguments without defaults as required.
Source code in taps/config.py
get_transformer() ¶
get_transformer() -> ProxyTransformer
Create a transformer instance from the config.
Source code in taps/data/proxy.py
ProxyTransformer ¶
Proxy object transformer.
Transforms objects into proxies which act as the identifier.
Parameters:
-
store(Store[Any]) –Store instance to use for proxying objects.
-
extract_target(bool, default:False) –When
True, resolving an identifier (i.e., a proxy) will return the target object. Otherwise, the proxy is returned since a proxy can act as the target object.
Source code in taps/data/proxy.py
close() ¶
is_identifier() ¶
transform() ¶
transform(obj: T) -> Proxy[T]
Transform the object into an identifier.
Parameters:
-
obj(T) –Object to transform.
Returns:
-
Proxy[T]–Identifier object that can be used to resolve
obj.
resolve() ¶
Resolve an object from an identifier.
Parameters:
-
identifier(Proxy[T]) –Identifier to an object.
Returns:
-
T | Proxy[T]–The resolved object or a proxy of the resolved object depending on the setting of
extract_target.