{"id":3585,"library":"mypy-boto3-geo-maps","title":"mypy-boto3-geo-maps","description":"mypy-boto3-geo-maps provides type annotations for the `boto3` AWS LocationServiceMapsV2 service. It enhances development with static type checking, autocompletion, and improved code readability for `boto3` users. The library is actively maintained with frequent updates, aligning with `boto3` releases and the `mypy-boto3-builder`'s development cadence.","status":"active","version":"1.42.84","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","types","mypy","typing","stubs","geo-maps","location-service"],"install":[{"cmd":"pip install mypy-boto3-geo-maps boto3","lang":"bash","label":"Install with boto3"},{"cmd":"pip install 'boto3-stubs[geo-maps]' boto3","lang":"bash","label":"Install via boto3-stubs extras (recommended)"}],"dependencies":[{"reason":"This package provides type stubs for boto3's LocationServiceMapsV2. boto3 itself is required for runtime functionality, though not a direct installation dependency of the stub package.","package":"boto3","optional":false},{"reason":"May be required for older Python versions for certain typing features, though recent builder versions handle this dynamically.","package":"typing-extensions","optional":true}],"imports":[{"note":"Import the client type from `mypy_boto3_geo_maps` for static type checking. The actual runtime client is created via `boto3.client('geo-maps')`.","wrong":"from boto3.client import LocationServiceMapsV2Client","symbol":"LocationServiceMapsV2Client","correct":"from mypy_boto3_geo_maps.client import LocationServiceMapsV2Client"},{"note":"Type definitions for service requests and responses are located in the `type_defs` submodule.","symbol":"CreateMapRequestRequestTypeDef","correct":"from mypy_boto3_geo_maps.type_defs import CreateMapRequestRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_geo_maps.client import LocationServiceMapsV2Client\n    from mypy_boto3_geo_maps.type_defs import CreateMapRequestRequestTypeDef\n\n# Get a typed client for AWS Location Service (Maps V2)\nclient: 'LocationServiceMapsV2Client' = boto3.client(\"geo-maps\")\n\n# Example usage with a typed request (for illustration, not runnable without AWS creds)\ntry:\n    # Define a request payload using TypeDef\n    create_map_request: CreateMapRequestRequestTypeDef = {\n        \"MapName\": \"MyTestMap\",\n        \"Configuration\": {\"Style\": \"VectorEsriStreets\"},\n        \"Description\": \"A test map created via mypy-boto3-geo-maps\",\n    }\n\n    # The actual API call (will raise ClientError without valid AWS setup)\n    response = client.create_map(**create_map_request)\n    print(f\"Successfully initiated map creation: {response['MapArn']}\")\n\nexcept client.exceptions.ConflictException as e:\n    print(f\"Map already exists: {e}\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\n# Example of getting a static map (assuming a map exists and permissions are set)\n# This call would require valid map name and API key if used publicly\n# response = client.get_static_map(\n#     MapName=\"MyTestMap\",\n#     CenterX=-77.0369,\n#     CenterY=38.9072,\n#     Zoom=12,\n#     Width=400,\n#     Height=300\n# )\n# print(f\"Received static map data: {len(response['ImageData'])} bytes\")\n","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted `LocationServiceMapsV2Client` and construct a typed request using `TypeDef`s provided by `mypy-boto3-geo-maps`. The `TYPE_CHECKING` block ensures that these imports are only used by type checkers, avoiding runtime dependencies. Replace placeholder values and ensure AWS credentials are configured for actual execution."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or a newer supported version.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0 (which generated `mypy-boto3-geo-maps 1.42.84`). Projects using Python 3.8 will need to upgrade to Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (mypy-boto3-geo-maps >=1.42.84)"},{"fix":"Review your code for explicitly imported TypeDefs and update their names according to the new convention. Consult the `mypy-boto3-builder` changelog for specific renaming patterns.","message":"Breaking changes in `mypy-boto3-builder` 8.9.0 introduced shorter names for TypeDefs for packed method arguments (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This affects explicit imports of such TypeDefs.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0"},{"fix":"Ensure `mypy` is up-to-date. No specific action is usually required, as `mypy` should automatically discover PEP 561 compliant packages. If issues persist, check `mypy`'s `installed-packages` documentation.","message":"As of `mypy-boto3-builder` 8.12.0, all `mypy-boto3` packages (including `mypy-boto3-geo-maps`) are PEP 561 compliant. This generally simplifies `mypy`'s ability to find stubs, but if you had a custom or non-standard `mypy` setup for older versions, you might need to ensure your `mypy` configuration is up-to-date.","severity":"gotcha","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Wrap `mypy-boto3-geo-maps` imports in `if TYPE_CHECKING:` blocks and define runtime fallbacks (e.g., `Client = object`) for `pylint` compatibility. This prevents `mypy-boto3-geo-maps` from being a runtime dependency.","message":"When using `pylint`, it may report 'undefined variables' for type-hinted clients or TypeDefs, especially if `mypy-boto3` packages are not in `install_requires` for production builds. Using a `TYPE_CHECKING` guard can mitigate this.","severity":"gotcha","affected_versions":"All versions when using pylint"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}