benchling_sdk.apps.config.scalars module¶
- class BoolScalar¶
Bases:
benchling_sdk.apps.config.scalars.ScalarDefinition
[bool
]Bool Scalar.
Turn a Boolean-like string value into bool. Any permutation of âtrueâ - case insensitive - is interpreted as True. Any other non-empty string is False.
- class DateScalar¶
Bases:
benchling_sdk.apps.config.scalars.ScalarDefinition
[datetime.date
]Date Scalar.
Turn an ISO formatted date like YYYY-MM-dd into a date.
- class DateTimeScalar¶
Bases:
benchling_sdk.apps.config.scalars.ScalarDefinition
[datetime.datetime
]Date Time Scalar.
Turn a date time string into datetime.
- class FloatScalar¶
Bases:
benchling_sdk.apps.config.scalars.ScalarDefinition
[float
]Float Scalar.
Turn a string into float. Assumes the string, if not empty, is a valid floating point.
- class IntScalar¶
Bases:
benchling_sdk.apps.config.scalars.ScalarDefinition
[int
]Int Scalar.
Turn a string into int. Assumes the string, if not empty, is a valid integer.
- class JsonScalar¶
Bases:
benchling_sdk.apps.config.scalars.ScalarDefinition
[Union
[Dict
[str
,Any
],List
[Any
],str
,int
,float
,bool
]]Json Scalar.
Turn a string into JSON. Assumes the string is a valid JSON string.
- class ScalarDefinition¶
Bases:
abc.ABC
,Generic
[benchling_sdk.apps.config.scalars.ScalarType
]Scalar definition.
Map how ScalarConfigTypes values can be converted into corresponding Python types.
- abstract from_str(value: Optional[str]) Optional[benchling_sdk.apps.config.scalars.ScalarType] ¶
From string.
Given an optional string value of scalar configuration, produce an Optional instance of the specific ScalarType. For instance, converting str to int.
Used when coercing Python types from string values in API responses.
- classmethod init()¶
Init.
- class SecureTextScalar¶
Bases:
benchling_sdk.apps.config.scalars.TextScalar
Secure Text Scalar.
Text is already a string, so no conversion is performed.