{"id":3015,"library":"mypy-boto3-appconfigdata","title":"Type annotations for boto3 AppConfigData","description":"mypy-boto3-appconfigdata provides a standalone package of type annotations for the boto3 AppConfigData service client. It enhances development with static type checking by tools like mypy and provides improved IDE autocompletion for `boto3.client(\"appconfigdata\")`. The current version is 1.42.3, with releases typically synchronized with boto3 versions and updates from the mypy-boto3-builder.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hinting","stubs","appconfigdata","aws-appconfigdata"],"install":[{"cmd":"pip install mypy-boto3-appconfigdata","lang":"bash","label":"Standalone package"},{"cmd":"pip install 'boto3-stubs[appconfigdata]'","lang":"bash","label":"As part of boto3-stubs"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK, these are type stubs for it.","package":"boto3"},{"reason":"Primary static type checker this library is designed for.","package":"mypy","optional":true},{"reason":"Requires Python 3.9 or newer.","package":"python","optional":false}],"imports":[{"note":"Import the client type directly for explicit type hinting.","symbol":"AppConfigDataClient","correct":"from mypy_boto3_appconfigdata import AppConfigDataClient"},{"note":"Import specific TypedDicts for request/response payloads.","symbol":"GetLatestConfigurationRequestTypeDef","correct":"from mypy_boto3_appconfigdata.type_defs import GetLatestConfigurationRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_appconfigdata import AppConfigDataClient\nfrom mypy_boto3_appconfigdata.type_defs import GetLatestConfigurationRequestTypeDef\nimport os\n\ndef get_configuration_data(application: str, environment: str, configuration: str, client_id: str) -> dict:\n    session = boto3.Session(\n        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'),\n        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET'),\n        region_name=os.environ.get('AWS_REGION', 'us-east-1')\n    )\n    client: AppConfigDataClient = session.client(\"appconfigdata\")\n\n    # First, start a session to get a configuration token\n    start_session_params = {\n        \"ApplicationIdentifier\": application,\n        \"ConfigurationIdentifier\": configuration,\n        \"ClientConfigurationVersion\": \"1.0\" # Example version, replace as needed\n    }\n    start_session_response = client.start_configuration_session(**start_session_params)\n    configuration_token = start_session_response[\"InitialConfigurationToken\"]\n\n    # Then, get the latest configuration using the token\n    get_config_params: GetLatestConfigurationRequestTypeDef = {\n        \"ConfigurationToken\": configuration_token\n    }\n    response = client.get_latest_configuration(**get_config_params)\n    \n    # The configuration is returned as a streaming body\n    if 'Configuration' in response and response['Configuration']:\n        config_data = response['Configuration'].read().decode('utf-8')\n        print(f\"Received configuration: {config_data}\")\n        return {\"data\": config_data, \"content_type\": response.get('ContentType')}\n    return {}\n\n# Example usage (will use dummy credentials if env vars are not set)\nif __name__ == \"__main__\":\n    # These values would typically come from your AppConfig setup\n    app_id = \"MyApplication\"\n    env_id = \"MyEnvironment\"\n    config_id = \"MyConfigurationProfile\"\n    client_id = \"my-unique-client\"\n\n    print(\"Attempting to get AppConfig data...\")\n    config = get_configuration_data(app_id, env_id, config_id, client_id)\n    if config:\n        print(\"Successfully retrieved configuration.\")\n    else:\n        print(\"Failed to retrieve configuration or no configuration found.\")\n","lang":"python","description":"This quickstart demonstrates how to use the `mypy-boto3-appconfigdata` type annotations with a boto3 AppConfigData client. It shows how to initialize the client with type hints, start a configuration session, and retrieve the latest configuration, including the use of generated TypedDicts for method parameters. Environment variables are used for AWS credentials for runnable examples."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer. Consider using Python 3.9+.","message":"Version 8.12.0 of the underlying `mypy-boto3-builder` (which generates this stub package) removed support for Python 3.8. Users on Python 3.8 must upgrade their Python version.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Review type definition imports and usages after upgrading. IDEs with type checking will highlight incorrect names.","message":"With `mypy-boto3-builder` version 8.9.0, some TypeDef naming conventions changed (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). While specific to other services, similar changes may occur in AppConfigData type definitions in future updates, requiring code adjustments.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0, mypy-boto3-appconfigdata potentially affected by future builder releases"},{"fix":"In the `else` block of your `if TYPE_CHECKING:` statement, explicitly set the imported types to `object` to satisfy Pylint. E.g., `else: AppConfigDataClient = object`.","message":"Pylint may complain about undefined variables when using `TYPE_CHECKING` guards to conditionally import stubs. This happens if the `else` branch does not define the types (e.g., `Client = object`).","severity":"gotcha","affected_versions":"All versions when using `TYPE_CHECKING` with Pylint"},{"fix":"If performance is an issue, consider installing the `boto3-stubs-lite[appconfigdata]` package instead, which is more RAM-friendly but requires more explicit type annotations. Alternatively, disable PyCharm's type checker and rely solely on external tools like mypy.","message":"PyCharm users might experience slow performance with `Literal` overloads in `boto3-stubs`. This is a known issue (PY-40997) within PyCharm itself.","severity":"gotcha","affected_versions":"All versions when used with affected PyCharm versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}