query¶
Data models related to OPTIMADE queries.
QUERY_PARAMETERS = {'annotations': {name: FieldInfo.from_annotation(parameter.annotation)for (name, parameter) in inspect.signature(EntryListingQueryParams).parameters.items()}, 'defaults': EntryListingQueryParams()}
module-attribute
¶
Entry listing URL query parameters from the optimade
package
(EntryListingQueryParams
).
OPTIMADEQueryParameters
¶
Bases: BaseModel
Common OPTIMADE entry listing endpoint query parameters.
Source code in oteapi_optimade/models/query.py
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 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
api_hint: Annotated[Optional[str], Field(description='If the client provides the parameter, the value SHOULD have the format `vMAJOR` or `vMAJOR.MINOR`, where MAJOR is a major version and MINOR is a minor version of the API. For example, if a client appends `api_hint=v1.0` to the query string, the hint provided is for major version 1 and minor version 0.', pattern='(v[0-9]+(\\.[0-9]+)?)?')] = ''
class-attribute
instance-attribute
¶
email_address: Annotated[Optional[EmailStr], Field(description=QUERY_PARAMETERS['annotations']['email_address'].description)] = QUERY_PARAMETERS['defaults'].email_address or None
class-attribute
instance-attribute
¶
filter: Annotated[Optional[str], Field(description=QUERY_PARAMETERS['annotations']['filter'].description)] = QUERY_PARAMETERS['defaults'].filter or None
class-attribute
instance-attribute
¶
include: Annotated[Optional[str], Field(description=QUERY_PARAMETERS['annotations']['include'].description)] = QUERY_PARAMETERS['defaults'].include or None
class-attribute
instance-attribute
¶
page_above: Annotated[Optional[int], Field(description=QUERY_PARAMETERS['annotations']['page_above'].description)] = QUERY_PARAMETERS['defaults'].page_above or None
class-attribute
instance-attribute
¶
page_below: Annotated[Optional[int], Field(description=QUERY_PARAMETERS['annotations']['page_below'].description)] = QUERY_PARAMETERS['defaults'].page_below or None
class-attribute
instance-attribute
¶
page_cursor: Annotated[Optional[int], Field(description=QUERY_PARAMETERS['annotations']['page_cursor'].description, ge=QUERY_PARAMETERS['annotations']['page_cursor'].metadata[0].ge)] = QUERY_PARAMETERS['defaults'].page_cursor or None
class-attribute
instance-attribute
¶
page_limit: Annotated[Optional[int], Field(description=QUERY_PARAMETERS['annotations']['page_limit'].description, ge=QUERY_PARAMETERS['annotations']['page_limit'].metadata[0].ge)] = QUERY_PARAMETERS['defaults'].page_limit or None
class-attribute
instance-attribute
¶
page_number: Annotated[Optional[int], Field(description=QUERY_PARAMETERS['annotations']['page_number'].description)] = QUERY_PARAMETERS['defaults'].page_number or None
class-attribute
instance-attribute
¶
page_offset: Annotated[Optional[int], Field(description=QUERY_PARAMETERS['annotations']['page_offset'].description, ge=QUERY_PARAMETERS['annotations']['page_offset'].metadata[0].ge)] = QUERY_PARAMETERS['defaults'].page_offset or None
class-attribute
instance-attribute
¶
response_fields: Annotated[Optional[str], Field(description=QUERY_PARAMETERS['annotations']['response_fields'].description, pattern=QUERY_PARAMETERS['annotations']['response_fields'].metadata[0].pattern)] = QUERY_PARAMETERS['defaults'].response_fields or None
class-attribute
instance-attribute
¶
response_format: Annotated[Optional[str], Field(description=QUERY_PARAMETERS['annotations']['response_format'].description)] = QUERY_PARAMETERS['defaults'].response_format or None
class-attribute
instance-attribute
¶
sort: Annotated[Optional[str], Field(description=QUERY_PARAMETERS['annotations']['sort'].description, pattern=QUERY_PARAMETERS['annotations']['sort'].metadata[0].pattern)] = QUERY_PARAMETERS['defaults'].sort or None
class-attribute
instance-attribute
¶
generate_query_string()
¶
Generate a valid URL query string based on the set fields.
Source code in oteapi_optimade/models/query.py
151 152 153 154 155 156 157 |
|