{"id":3837,"library":"types-boto3-dynamodb","title":"Type annotations for boto3 DynamoDB","description":"types-boto3-dynamodb provides comprehensive type annotations for the `boto3` AWS SDK's DynamoDB service. It is part of the `types-boto3` project and is generated by `mypy-boto3-builder` 8.12.0. These stubs enhance developer experience by enabling static type checking, autocompletion, and improved readability for `boto3` interactions with DynamoDB, compatible with tools like VSCode, PyCharm, mypy, and pyright. The library is actively maintained with frequent updates to align with new `boto3` versions and Python features.","status":"active","version":"1.42.73","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","dynamodb","typing","type-hints","mypy","pyright","stubs"],"install":[{"cmd":"pip install 'types-boto3[dynamodb]'","lang":"bash","label":"Recommended (as part of types-boto3 bundle)"},{"cmd":"pip install types-boto3-dynamodb","lang":"bash","label":"Standalone DynamoDB stubs"}],"dependencies":[{"reason":"Provides the runtime functionality for which these stubs offer type hints. This package provides type information, not runtime code.","package":"boto3","optional":false}],"imports":[{"wrong":"from boto3_stubs.dynamodb import DynamoDBClient","symbol":"DynamoDBClient","correct":"from boto3_stubs.dynamodb import DynamoDBClient"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from types_boto3_dynamodb import DynamoDBClient, DynamoDBServiceResource\n    from types_boto3_dynamodb.service_resource import Table\n\n\ndef get_dynamodb_client() -> 'DynamoDBClient':\n    \"\"\"Returns a type-hinted DynamoDB client.\"\"\"\n    return boto3.client('dynamodb')\n\n\ndef get_dynamodb_resource() -> 'DynamoDBServiceResource':\n    \"\"\"Returns a type-hinted DynamoDB service resource.\"\"\"\n    return boto3.resource('dynamodb')\n\n\ndef get_table(table_name: str) -> 'Table':\n    \"\"\"Returns a type-hinted DynamoDB Table resource.\"\"\"\n    dynamodb_resource: DynamoDBServiceResource = get_dynamodb_resource()\n    return dynamodb_resource.Table(table_name)\n\n# Example usage (without actual AWS calls):\nclient = get_dynamodb_client()\nprint(f\"DynamoDB client type: {type(client)}\")\n\nresource = get_dynamodb_resource()\nprint(f\"DynamoDB resource type: {type(resource)}\")\n\n# You would typically interact with a real table here\n# table = get_table(\"YourTableName\")\n# print(f\"DynamoDB table type: {type(table)}\")","lang":"python","description":"This quickstart demonstrates how to obtain type-hinted DynamoDB clients, service resources, and table resources using `types-boto3-dynamodb`. It leverages `typing.TYPE_CHECKING` to ensure the type stubs are only used during static analysis, preventing runtime dependencies in production. The `boto3` library must be installed alongside these type stubs for full functionality."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Python 3.8 support has been removed. `types-boto3-dynamodb` and its builder `mypy-boto3-builder` now require Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder 8.12.0 and later, affecting types-boto3-dynamodb versions generated by it."},{"fix":"Ensure your type checker (e.g., mypy, pyright) is up-to-date and configured to correctly resolve PEP 561 packages. Most users should not encounter issues with standard setups.","message":"The project migrated to PEP 561 compliant packages. This might require adjustments in how some build systems or advanced type checker configurations resolve imports, though direct usage often remains compatible.","severity":"breaking","affected_versions":"mypy-boto3-builder 8.12.0 and later, affecting types-boto3-dynamodb versions generated by it."},{"fix":"Review your code for direct imports or usage of generated TypedDicts and update their names according to the new conventions, referring to the latest generated documentation or code completions.","message":"TypeDef naming conventions were changed for some packed method arguments and conflicting names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). If you directly reference these generated TypedDicts, your code may break.","severity":"breaking","affected_versions":"mypy-boto3-builder 8.9.0 and later, affecting types-boto3-dynamodb versions generated by it."},{"fix":"Wrap type stub imports and annotations with `if TYPE_CHECKING: ... else: ...` blocks. For example: `if TYPE_CHECKING: from types_boto3_dynamodb import DynamoDBClient else: DynamoDBClient = object`.","message":"For optimal production environments, it is recommended to conditionally import type hints using `if TYPE_CHECKING:` to prevent adding the stub package as a runtime dependency. This avoids potential `pylint` warnings if not handled correctly.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider using `types-boto3-lite` (a leaner version of stubs) if available for your service, or disable PyCharm's built-in type checker and rely on external tools like mypy or pyright instead for type checking.","message":"PyCharm users might experience slow performance and high CPU usage, especially with `Literal` overloads. This is a known issue (PY-40997) within PyCharm's type checker.","severity":"gotcha","affected_versions":"All versions, specific to PyCharm IDE."},{"fix":"Prefer `types-boto3` and its specific service packages (like `types-boto3-dynamodb`) in new projects and when updating dependencies. Update any `boto3-stubs` references in `install_requires` or similar configurations.","message":"The overarching project name for boto3 type stubs has transitioned from `boto3-stubs` to `types-boto3`. While `types-boto3-dynamodb` remains the specific package for DynamoDB, users migrating from older setups or referencing older documentation should be aware of this change.","severity":"gotcha","affected_versions":"Starting with mypy-boto3-builder 8.x, the main project was renamed."}],"env_vars":null,"search_vec":"'8.12.0':39 'activ':71 'align':77 'annot':2,13 'autocomplet':50 'aw':17,85 'boto3':4,8,16,29,37,55,80,86 'builder':38 'check':49 'compat':59 'comprehens':11 'develop':43 'dynamodb':5,9,20,58,87 'enabl':46 'enhanc':42 'experi':44 'featur':84 'frequent':74 'generat':33 'hint':91 'improv':52 'interact':56 'librari':69 'like':62 'maintain':72 'mypi':36,65,92 'mypy-boto3-builder':35 'new':79 'part':24 'project':30 'provid':10 'pycharm':64 'pyright':67,93 'python':83 'readabl':53 'sdk':18 'servic':21 'static':47 'stub':41,94 'tool':61 'type':1,7,12,28,48,88,90 'type-hint':89 'types-boto3':27 'types-boto3-dynamodb':6 'updat':75 'version':81 'vscode':63","created_at":"2026-04-11T17:46:48.540089+00:00","updated_at":"2026-04-16T23:31:12.650406+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'boto3_stubs'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.64","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/youtype/mypy_boto3_builder","docs":"https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/","changelog":null,"pypi":"https://pypi.org/project/types-boto3-dynamodb/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","aws","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-29","next_check":"2026-07-10","install_tag":null}}