Skip to content

SetKeyBuilder

set_key

set_key(key: str) -> SetKeyBuilder

Set this context key using another value

Parameters:

  • *key (str) –

    They context key to set

Returns:

  • SetKeyBuilder

    A SetKeyBuilder instance to continue defining additional combinator properties

SetKeyBuilder

Constructs combinators to set context key values

by

by(from_: Get) -> Combinator

Set the previously selected context key to the result after performing the manipulations from the provided Get instance

Parameters:

  • *from_ (Get) –

    The Get instance that encodes the manipulations to perform

Returns:

  • Combinator

    A combinator that encodes the setter logic defined by the SetKeyBuilder chain

from_

from_(*source: Retriever | int) -> Combinator

Set the previously selected context key to the value of this retriever

Parameters:

  • *source (Retriever | int, default: () ) –

    The retriever path to fetch the value from. This can be a sequence of retrievers/list indices starting in the current struct

Returns:

  • Combinator

    A combinator that encodes the setter logic defined by the SetKeyBuilder chain

from_len

from_len(*source: Retriever | int) -> Combinator

Set the previously selected context key to the length of this value if it is a list

Parameters:

  • *source (Retriever | int, default: () ) –

    The retriever path to fetch the value from. This can be a sequence of retrievers/list indices starting in the current struct

Returns:

  • Combinator

    A combinator that encodes the setter logic defined by the SetKeyBuilder chain

Raises:

  • ValueError

    if the source value is not a list