Regex type cast
RegexCastType
Bases: Input
Model for Regex Cast Type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
regex
|
str
|
Regex to test against. |
required |
cast_type
|
str
|
Python type to cast to. |
required |
Source code in extraction_methods/plugins/regex_type_cast.py
24 25 26 27 28 29 30 31 32 33 34 | |
RegexTypeCastExtract
Bases: ExtractionMethod
Takes a list of regex and cast type combinations. Any existing properties that full match a regex are cast to the associated type.
Method name: regex_type_cast
Example configuration
.. code-block:: yaml
- method: regex_type_cast
inputs:
regex_casts:
- regex: clound_cover
cast_type: int
noqa: W605
Source code in extraction_methods/plugins/regex_type_cast.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
RegexTypeCastInput
Bases: Input
Model for Regex Cast Type Input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
regex_casts
|
list[RegexCastType]
|
Regex and cast type combinations. |
required |
Source code in extraction_methods/plugins/regex_type_cast.py
37 38 39 40 41 42 43 44 | |