samgis_web.utilities package¶
Submodules¶
samgis_web.utilities.constants module¶
Project constants
samgis_web.utilities.local_tiles_http_server module¶
- class samgis_web.utilities.local_tiles_http_server.LocalTilesHttpServer(methodName='runTest')[source]¶
Bases:
TestCase- static http_server(host, port, directory)[source]¶
Function http_server defined within this test class to avoid pytest error “fixture ‘host’ not found”.
- Parameters:
host (
str) – Either the DNS name or the IP address where the server will listenport (
int) – number where the server will listen (common ports are 7860 or 8000)directory (
str|Path) – folder exposed by the http server
Returns:
samgis_web.utilities.type_hints module¶
custom type hints
- class samgis_web.utilities.type_hints.ApiRequestBody(**data)[source]¶
Bases:
BaseModelInput request validator type (not yet parsed)
- debug: bool¶
- id: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- prompt: list[RawPromptPoint | RawPromptRectangle]¶
- source_type: str¶
- zoom: int | float¶
- class samgis_web.utilities.type_hints.ApiResponseBodyFailure(**data)[source]¶
Bases:
BaseModelSamGIS API Response; handle only case of failure
- duration_run: float¶
- message: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- request_id: str¶
- class samgis_web.utilities.type_hints.ApiResponseBodySuccess(**data)[source]¶
Bases:
ApiResponseBodyFailureSamGIS API Response; handle both case of success and failure
- geojson: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- n_predictions: int¶
- n_shapes_geojson: int¶
- class samgis_web.utilities.type_hints.ContentTypes(*values)[source]¶
Bases:
str,EnumSegment Anything: validation point prompt type
- APPLICATION_JSON = 'application/json'¶
- TEXT_HTML = 'text/html'¶
- TEXT_PLAIN = 'text/plain'¶
- class samgis_web.utilities.type_hints.ImagePixelCoordinates[source]¶
Bases:
TypedDictImage pixel coordinates type
- x: int¶
- y: int¶
- class samgis_web.utilities.type_hints.LatLngDict(**data)[source]¶
Bases:
BaseModelGeneric geographic latitude-longitude type
- lat: float¶
- lng: float¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class samgis_web.utilities.type_hints.PromptLabel(*values)[source]¶
Bases:
IntEnumValid prompt label type
- EXCLUDE = 0¶
- INCLUDE = 1¶
- class samgis_web.utilities.type_hints.PromptPointType(*values)[source]¶
Bases:
str,EnumSegment Anything: validation point prompt type
- point = 'point'¶
- class samgis_web.utilities.type_hints.PromptRectangleType(*values)[source]¶
Bases:
str,EnumSegment Anything: validation rectangle prompt type
- rectangle = 'rectangle'¶
- class samgis_web.utilities.type_hints.RawBBox(**data)[source]¶
Bases:
BaseModelInput lambda bbox request type (not yet parsed)
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- ne: LatLngDict¶
- sw: LatLngDict¶
- class samgis_web.utilities.type_hints.RawPromptPoint(**data)[source]¶
Bases:
BaseModelInput lambda prompt request of type ‘PromptPointType’ - point (not yet parsed)
- data: LatLngDict¶
- label: PromptLabel¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type: PromptPointType¶
- class samgis_web.utilities.type_hints.RawPromptRectangle(**data)[source]¶
Bases:
BaseModelInput lambda prompt request of type ‘PromptRectangleType’ - rectangle (not yet parsed)
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type: PromptRectangleType¶
- class samgis_web.utilities.type_hints.StringPromptApiRequestBody(**data)[source]¶
Bases:
BaseModelInput lambda request validator type (not yet parsed)
- debug: bool¶
- id: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- source_type: str¶
- string_prompt: str¶
- zoom: int | float¶
- class samgis_web.utilities.type_hints.WorldFile(*values)[source]¶
Bases:
StrEnumDefault xyz provider names
- pgw = 'pgw'¶
- tfw = 'tfw'¶
Module contents¶
various helpers functions