OTE-API Configuration Models¶
This page provides documentation for the oteapi.models
submodule, where all the OTE-API strategy configuration data models are located.
When creating instances of these models, the data types are automatically validated.
oteapi.models
module.
This module contains all the pydantic
configuration models.
AttrDict
¶
Bases: BaseModel
, Mapping
An object whose attributes can also be accessed through subscription, like with a dictionary.
Source code in oteapi/models/genericconfig.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
Config
¶
Pydantic configuration for AttrDict
.
extra
Allow any attributes/fields to be defined - this is what makes this pydantic model an attribute dictionary.validate_assignment
Validate and cast set values. This is mainly relevant for sub-classes ofAttrDict
, where specific attributes have been defined.arbitrary_types_allowed
If a custom type is used for an attribute that doesn't have avalidate()
method, don't fail setting the attribute.
Source code in oteapi/models/genericconfig.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
get(key, default=None)
¶
Mapping get
-method.
Source code in oteapi/models/genericconfig.py
66 67 68 |
|
items()
¶
Return a view of all (key, value) pairs.
Source code in oteapi/models/genericconfig.py
54 55 56 |
|
keys()
¶
Return a view of all keys.
Source code in oteapi/models/genericconfig.py
58 59 60 |
|
pop(key, default=Undefined)
¶
MutableMapping pop
-method.
Source code in oteapi/models/genericconfig.py
98 99 100 101 102 103 104 105 |
|
popitem()
¶
MutableMapping popitem
-method.
Important
Unlike the regular dict.popitem()
method, this one does not respect
LIFO (last-in, first-out).
This is due to the fact that attributes are stored in a random order when
initializing the model.
However, it will respect LIFO with respect to the internal __dict__
.
Source code in oteapi/models/genericconfig.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
update(other=None, **kwargs)
¶
MutableMapping update
-method.
Source code in oteapi/models/genericconfig.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
values()
¶
Return a view of all values.
Source code in oteapi/models/genericconfig.py
62 63 64 |
|
DataCacheConfig
¶
Bases: AttrDict
DataCache Configuration.
This class should not be used directly as a configuration object for a strategy object, but only as a configuration field inside a configuration object.
Source code in oteapi/models/datacacheconfig.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
FilterConfig
¶
Bases: GenericConfig
Filter Strategy Data Configuration.
Source code in oteapi/models/filterconfig.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
FunctionConfig
¶
Bases: GenericConfig
, SecretConfig
Function Strategy Data Configuration.
Source code in oteapi/models/functionconfig.py
8 9 10 11 12 13 14 |
|
GenericConfig
¶
Bases: BaseModel
Generic class for configuration objects.
Source code in oteapi/models/genericconfig.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
Config
¶
Pydantic configuration for GenericConfig
.
validate_assignment
Validate and cast set values. This is mainly relevant for sub-classes ofAttrDict
, where specific attributes have been defined.arbitrary_types_allowed
If a custom type is used for an attribute that doesn't have avalidate()
method, don't fail setting the attribute.
Source code in oteapi/models/genericconfig.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
MappingConfig
¶
Bases: GenericConfig
Mapping Strategy Data Configuration.
Source code in oteapi/models/mappingconfig.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
ResourceConfig
¶
Bases: GenericConfig
, SecretConfig
Resource Strategy Data Configuration.
Important
Either of the pairs of attributes downloadUrl
/mediaType
or
accessUrl
/accessService
MUST be specified.
Source code in oteapi/models/resourceconfig.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
ensure_unique_url_pairs(values)
¶
Ensure either downloadUrl/mediaType or accessUrl/accessService are defined.
It's fine to define them all, but at least one complete pair MUST be specified.
Source code in oteapi/models/resourceconfig.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
SecretConfig
¶
Bases: BaseModel
Simple model for handling secret in other config-models.
Source code in oteapi/models/secretconfig.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
SessionUpdate
¶
Bases: AttrDict
Session Update Data Model for returning values.
Source code in oteapi/models/sessionupdate.py
5 6 |
|
TransformationConfig
¶
Bases: GenericConfig
, SecretConfig
Transformation Strategy Data Configuration.
Source code in oteapi/models/transformationconfig.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
TransformationStatus
¶
Bases: BaseModel
Return from transformation status.
Source code in oteapi/models/transformationconfig.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
TripleStoreConfig
¶
Bases: GenericConfig
, SecretConfig
TripleStore Configuration.
This is a configuration for the
TripleStore
.
This class should not be used directly as a configuration object for a strategy object, but only as a configuration field inside a configuration object.
Source code in oteapi/models/triplestoreconfig.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
Config
¶
Pydantic configuration for TripleStoreConfig.
Source code in oteapi/models/triplestoreconfig.py
43 44 45 46 47 48 49 50 51 52 |
|
fields = {'token': {'exclude': True}, 'client_id': {'exclude': True}, 'client_secret': {'exclude': True}}
class-attribute
¶
The fields
-config enables that token
, client_id
and client_secret
will be excluded, when the model is serialized.
ensure_user_pass(values)
¶
Ensure that user/password are set, since they are optional in the SecretConfig.
Source code in oteapi/models/triplestoreconfig.py
36 37 38 39 40 41 |
|