Registry / type-stubs / types-boto3-dynamodb

types-boto3-dynamodb

JSON →
library1.43.64pypypi✓ verified 25d ago

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.

pip install 'types-boto3[dynamodb]'
INSTALL
IMPORT
SIG · TYPES-BOTO3-DYNAMO
T
types-boto3-dynamodb
type-stubspythonv1.43.64
Install
3.2s avg
Import
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.64 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.1MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.2s · import 0.000s · 21MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DynamoDBClient
from boto3_stubs.dynamodb import DynamoDBClient
from boto3_stubs.dynamodb import DynamoDBClient

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.

import boto3 from typing import TYPE_CHECKING if TYPE_CHECKING: from types_boto3_dynamodb import DynamoDBClient, DynamoDBServiceResource from types_boto3_dynamodb.service_resource import Table def get_dynamodb_client() -> 'DynamoDBClient': """Returns a type-hinted DynamoDB client.""" return boto3.client('dynamodb') def get_dynamodb_resource() -> 'DynamoDBServiceResource': """Returns a type-hinted DynamoDB service resource.""" return boto3.resource('dynamodb') def get_table(table_name: str) -> 'Table': """Returns a type-hinted DynamoDB Table resource.""" dynamodb_resource: DynamoDBServiceResource = get_dynamodb_resource() return dynamodb_resource.Table(table_name) # Example usage (without actual AWS calls): client = get_dynamodb_client() print(f"DynamoDB client type: {type(client)}") resource = get_dynamodb_resource() print(f"DynamoDB resource type: {type(resource)}") # You would typically interact with a real table here # table = get_table("YourTableName") # print(f"DynamoDB table type: {type(table)}")
Debug
Known issues
breakingPython 3.8 support has been removed. `types-boto3-dynamodb` and its builder `mypy-boto3-builder` now require Python 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or higher.
affects: mypy-boto3-builder 8.12.0 and later, affecting types-boto3-dynamodb versions generated by it.
breakingThe 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.
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.
affects: mypy-boto3-builder 8.12.0 and later, affecting types-boto3-dynamodb versions generated by it.
breakingTypeDef 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.
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.
affects: mypy-boto3-builder 8.9.0 and later, affecting types-boto3-dynamodb versions generated by it.
gotchaFor 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.
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`.
affects: All versions
gotchaPyCharm 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.
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.
affects: All versions, specific to PyCharm IDE.
gotchaThe 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.
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.
affects: Starting with mypy-boto3-builder 8.x, the main project was renamed.
Upgrade
Version history
1.43.64latest on PyPI · released Aug 4, 2026
Audit
Dependencies
boto3requiredProvides the runtime functionality for which these stubs offer type hints. This package provides type information, not runtime code.
Agent activity
48 hits · last 30 days
node
42
Meta
1
OpenAI (training)
1
Resources
types-boto3-dynamodb — pip install types-boto3-dynamodb · libregistry