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) – 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¶
-
debug:
- 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¶
-
duration_run:
- 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¶
-
geojson:
- class samgis_web.utilities.type_hints.ContentTypes(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[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¶
-
x:
- 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].
-
lat:
- class samgis_web.utilities.type_hints.PromptLabel(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnumValid prompt label type
- EXCLUDE = 0¶
- INCLUDE = 1¶
- class samgis_web.utilities.type_hints.PromptPointType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str,EnumSegment Anything: validation point prompt type
- point = 'point'¶
- class samgis_web.utilities.type_hints.PromptRectangleType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[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¶
-
data:
- 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¶
-
debug:
- class samgis_web.utilities.type_hints.WorldFile(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
StrEnumDefault xyz provider names
- pgw = 'pgw'¶
- tfw = 'tfw'¶
- class samgis_web.utilities.type_hints.XYZDefaultProvidersNames(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
StrEnumDefault xyz provider names
- DEFAULT_TILES_NAME = 'openstreetmap.mapnik'¶
- DEFAULT_TILES_NAME_SHORT = 'openstreetmap'¶
- class samgis_web.utilities.type_hints.XYZTerrainProvidersNames(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
StrEnumCustom xyz provider names for digital elevation models
- MAPBOX_TERRAIN_TILES_NAME = 'mapbox.terrain-rgb'¶
- NEXTZEN_TERRAIN_TILES_NAME = 'nextzen.terrarium'¶
Module contents¶
various helpers functions