{"id":2822,"library":"types-aiobotocore-dynamodb","title":"types-aiobotocore-dynamodb Type Stubs","description":"This library provides type annotations (stubs) for `aiobotocore`'s DynamoDB service, enhancing static analysis tools like MyPy and IDE autocompletion for asynchronous AWS interactions. Currently at version 3.4.0, it is actively maintained with frequent updates tied to `aiobotocore` and `mypy-boto3-builder` releases.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type stubs","aiobotocore","aws","dynamodb","mypy","static analysis","async"],"install":[{"cmd":"pip install types-aiobotocore-dynamodb","lang":"bash","label":"Standalone Installation"},{"cmd":"pip install 'types-aiobotocore[dynamodb]'","lang":"bash","label":"With types-aiobotocore Extras"}],"dependencies":[{"reason":"Provides the asynchronous AWS client library for which these type stubs are generated.","package":"aiobotocore"}],"imports":[{"note":"The actual runtime client comes from aiobotocore, but type hints for it are provided by types-aiobotocore-dynamodb.","wrong":"from aiobotocore.client import DynamoDBClient","symbol":"DynamoDBClient","correct":"from types_aiobotocore_dynamodb.client import DynamoDBClient"},{"note":"Type hints for the service resource (high-level client) are provided here.","wrong":"from aiobotocore.resource import DynamoDBServiceResource","symbol":"DynamoDBServiceResource","correct":"from types_aiobotocore_dynamodb.service_resource import DynamoDBServiceResource"}],"quickstart":{"code":"import asyncio\nimport os\nfrom aiobotocore.session import get_session\nfrom types_aiobotocore_dynamodb.client import DynamoDBClient\n\nasync def list_dynamodb_tables():\n    # aiobotocore automatically picks up credentials from environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)\n    # or ~/.aws/credentials and ~/.aws/config\n    session = get_session()\n    async with session.create_client(\"dynamodb\", region_name=os.environ.get('AWS_REGION', 'us-east-1')) as client:\n        client: DynamoDBClient # Explicit type hint for static analysis\n        print(f\"Listing DynamoDB tables in {client.meta.region_name}...\")\n        response = await client.list_tables()\n        tables = response.get(\"TableNames\", [])\n        if tables:\n            print(\"Found tables:\", \", \".join(tables))\n        else:\n            print(\"No tables found.\")\n\nif __name__ == \"__main__\":\n    # Ensure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_REGION are set in your environment\n    # For a runnable example, you might need valid AWS credentials configured.\n    # Example placeholder: os.environ['AWS_REGION'] = 'us-east-1'\n    asyncio.run(list_dynamodb_tables())\n","lang":"python","description":"This quickstart demonstrates how to use `types-aiobotocore-dynamodb` to get type hints for an `aiobotocore` DynamoDB client, then list tables in your AWS account. It leverages `aiobotocore`'s automatic credential discovery."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Python 3.8 support has been removed in `mypy-boto3-builder` version 8.12.0, which generates these type stubs. Users on Python 3.8 or older will need to upgrade to Python 3.9+ to use the latest versions of these stubs.","severity":"breaking","affected_versions":">=8.12.0 (mypy-boto3-builder)"},{"fix":"Ensure your type checker (e.g., MyPy, Pyright) and IDE are updated and correctly configured to recognize PEP 561 stub packages.","message":"The underlying `mypy-boto3-builder` (version 8.12.0) migrated to PEP 561 compliant packages. This change might affect how type checkers or development environments discover and resolve type stubs, particularly in complex project setups.","severity":"breaking","affected_versions":">=8.12.0 (mypy-boto3-builder)"},{"fix":"Review and update explicit TypeDef imports and references in your codebase according to the latest documentation or builder output.","message":"Starting with `mypy-boto3-builder` 8.9.0, some TypeDef names may have been shortened or altered (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`) or conflicting postfixes moved for consistency. This could break explicit references to these TypedDicts in your code.","severity":"breaking","affected_versions":">=8.9.0 (mypy-boto3-builder)"},{"fix":"Install the specific service package (e.g., `pip install types-aiobotocore-dynamodb`) or use `pip install 'types-aiobotocore[dynamodb]'` or `pip install 'types-aiobotocore[full]'` to ensure all necessary type stubs are available.","message":"The `types-aiobotocore` ecosystem generates separate packages for each AWS service (e.g., `types-aiobotocore-dynamodb`). Installing only `types-aiobotocore` (without service extras or the `full` extra) will not provide type hints for individual services like DynamoDB.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add explicit type annotations when type inference is insufficient or for improved code clarity.","message":"While many IDEs and static analyzers can infer types implicitly, for `types-aiobotocore-lite` or standalone service packages, explicit type annotations (e.g., `client: DynamoDBClient`) might be required or provide clearer hints for optimal type checking and autocompletion.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider `pip install types-aiobotocore-lite` for better performance or configure PyCharm to use an external type checker.","message":"PyCharm users might experience slow performance with `Literal` overloads provided by these stubs (due to PyCharm issue PY-40997). The documentation recommends using `types-aiobotocore-lite` or disabling PyCharm's internal type checker in favor of external tools like MyPy or Pyright.","severity":"gotcha","affected_versions":"All versions (PyCharm specific)"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}