{"id":3093,"library":"mypy-boto3-geo-places","title":"mypy-boto3-geo-places type annotations for AWS Location Service Places V2","description":"This library provides comprehensive type annotations for the `boto3` AWS SDK, specifically for the Location Service Places V2. Generated by `mypy-boto3-builder`, it enhances developer experience by enabling static type checking with tools like Mypy and improving IDE features like autocompletion and error detection for `boto3` calls. The current version is 1.42.82, with releases typically synchronized with `boto3` updates and `mypy-boto3-builder` enhancements.","status":"active","version":"1.42.82","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","typing","mypy","type-stubs","geo-places","location-service"],"install":[{"cmd":"pip install mypy-boto3-geo-places boto3","lang":"bash","label":"Install type stubs and boto3"}],"dependencies":[{"reason":"Runtime library for which these are type stubs.","package":"boto3","optional":false}],"imports":[{"symbol":"LocationServicePlacesV2Client","correct":"from mypy_boto3_geo_places.client import LocationServicePlacesV2Client"},{"note":"Type definitions for API responses are available in the `type_defs` submodule.","symbol":"SearchPlaceIndexForTextResponseTypeDef","correct":"from mypy_boto3_geo_places.type_defs import SearchPlaceIndexForTextResponseTypeDef"},{"note":"Literals for service-specific enumerations are available in the `literals` submodule.","symbol":"PlacesIndexNameType","correct":"from mypy_boto3_geo_places.literals import PlacesIndexNameType"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_geo_places.client import LocationServicePlacesV2Client\n    from mypy_boto3_geo_places.type_defs import SearchPlaceIndexForTextResponseTypeDef\n\n\ndef search_places(index_name: str, text: str) -> SearchPlaceIndexForTextResponseTypeDef:\n    client: LocationServicePlacesV2Client = boto3.client(\"geo-places\", region_name=\"us-east-1\")\n    response: SearchPlaceIndexForTextResponseTypeDef = client.search_place_index_for_text(\n        IndexName=index_name,\n        Text=text\n    )\n    return response\n\n# Example usage (will not run without actual AWS credentials and an index)\nif __name__ == \"__main__\":\n    # Replace with your actual index name\n    my_index = \"YOUR_PLACE_INDEX_NAME\"\n    search_query = \"coffee shop in New York\"\n\n    try:\n        # Mock environment variables for demonstration, replace with actual if running\n        import os\n        os.environ['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY')\n        os.environ['AWS_SECRET_ACCESS_KEY'] = os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET')\n\n        result = search_places(my_index, search_query)\n        print(f\"Found {len(result['Results'])} places.\")\n        for place in result['Results']:\n            print(f\"  Place: {place['Place']['Label']}\")\n    except Exception as e:\n        print(f\"An error occurred (expected without proper AWS setup): {e}\")","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-geo-places` to type-hint a `boto3` Location Service Places V2 client and its API responses. The `TYPE_CHECKING` block ensures that the type imports are only active during static analysis, avoiding runtime dependencies. Remember that `boto3` itself needs to be configured with AWS credentials to make actual API calls."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher. Update `boto3` and `mypy-boto3-geo-places` accordingly.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and subsequently for all generated `mypy-boto3` packages. Users must upgrade to Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Review your imports and usage of explicitly typed `TypeDef` objects. Update their names to reflect the new conventions if affected. This is less likely to affect `geo-places` directly but is a general builder change.","message":"TypeDef naming conventions were changed in `mypy-boto3-builder` 8.9.0. Some TypeDefs for packed method arguments now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). Conflicting `Extra` postfixes were also moved to the end.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Ensure `boto3` is installed in your environment: `pip install boto3`.","message":"This package provides only type stubs and does not include the `boto3` runtime library. `boto3` must be installed separately to enable actual AWS API interactions.","severity":"gotcha","affected_versions":"All"},{"fix":"Explicitly type-hint your `boto3` clients/resources as shown in the quickstart (e.g., `client: LocationServicePlacesV2Client = boto3.client(\"geo-places\")`).","message":"For optimal autocompletion and type checking in IDEs like VSCode, explicit type annotations for `boto3.client()` and `boto3.resource()` calls are often recommended, especially if the IDE's Python extension does not fully support function overloads.","severity":"gotcha","affected_versions":"All"},{"fix":"Consider installing `boto3-stubs-lite` if you experience performance issues in PyCharm (`pip install boto3-stubs-lite`). Alternatively, rely on external type checkers like `mypy` or `pyright`.","message":"When using `mypy-boto3` packages with PyCharm, you might encounter slow performance or high CPU usage due to `Literal` overloads. It is recommended to try `boto3-stubs-lite` or disable PyCharm's internal type checker and use `mypy` or `pyright` instead.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}