Registry / type-stubs / mypy-boto3-dynamodb

mypy-boto3-dynamodb

JSON →
library1.43.64pypypi✓ verified 24d ago

mypy-boto3-dynamodb provides type annotations for the `boto3` DynamoDB service client and resource, generated by `mypy-boto3-builder`. It ensures type-checking accuracy for your boto3 calls related to DynamoDB. The current version is 1.42.73 and it releases frequently, often in lockstep with boto3/botocore updates.

pip install mypy-boto3-dynamodb
INSTALL
IMPORT
SIG · MYPY-BOTO3-DYNAMOD
M
mypy-boto3-dynamodb
type-stubspythonv1.43.64
Install
2.9s avg
Import
Disk
61MB
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 · 18.7MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.9s · import 0.000s · 19MB
61MB installed
● package 61MB
Code
Verified usage

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

DynamoDBClient
from mypy_boto3_dynamodb import DynamoDBClient
from mypy_boto3_dynamodb import DynamoDBClient
DynamoDBServiceResource
from mypy_boto3_dynamodb import DynamoDBServiceResource
ServiceResource
from mypy_boto3_dynamodb import ServiceResource

This quickstart demonstrates how to use `mypy-boto3-dynamodb` to type-hint a `boto3` DynamoDB client and a `CreateTableInputRequestTypeDef` for creating a table. The types provide autocompletion and static analysis for your DynamoDB operations.

import boto3 from mypy_boto3_dynamodb.client import DynamoDBClient from mypy_boto3_dynamodb.type_defs import CreateTableInputRequestTypeDef def create_table_example(table_name: str, region: str = 'us-east-1'): client: DynamoDBClient = boto3.client('dynamodb', region_name=region) table_params: CreateTableInputRequestTypeDef = { 'TableName': table_name, 'KeySchema': [ {'AttributeName': 'id', 'KeyType': 'HASH'} ], 'AttributeDefinitions': [ {'AttributeName': 'id', 'AttributeType': 'S'} ], 'BillingMode': 'PAY_PER_REQUEST' } print(f"Attempting to create table {table_name}...") try: response = client.create_table(**table_params) print(f"Table creation initiated: {response['TableDescription']['TableArn']}") except client.exceptions.ResourceInUseException: print(f"Table {table_name} already exists.") except Exception as e: print(f"Error creating table: {e}") if __name__ == '__main__': # This example requires valid AWS credentials configured (e.g., via AWS CLI or environment variables) # It's intended for demonstration; actual resource creation might incur costs. # Create a dummy table name for testing. test_table_name = 'MyTestTableForMypyBoto3' create_table_example(test_table_name) # Note: In a real scenario, you'd likely wait for the table to become active # and then delete it after testing to avoid accumulating resources.
Debug
Known issues
breakingStarting with version 8.12.0, mypy-boto3-builder (and thus mypy-boto3-dynamodb) removed support for Python 3.8. Ensure your project is running on Python 3.9 or higher.
fix
Upgrade your Python environment to 3.9 or newer.
affects: >=8.12.0
gotchaType definition (TypeDef) names for request/response objects can change between major versions or updates to reflect AWS API changes or internal renaming conventions. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef` in version 8.9.0 (for CloudFront). This can break type hints in your code.
fix
Refer to the official documentation or the `mypy-boto3` changelog for specific service updates. Update your TypeDef imports and usages accordingly.
affects: >=8.9.0
gotchaAWS service names can be deprecated or renamed, leading to stubs for old service names being removed or requiring migration to new ones. For instance, `sms-voice` stubs were removed in favor of `pinpoint-sms-voice` in version 8.11.0.
fix
Check the `mypy-boto3` changelog or AWS service documentation if your service-specific stub import fails or appears deprecated. Update to the correct service name and import path.
affects: >=8.11.0
gotchaIf you only need stubs for a specific AWS service like DynamoDB, install `mypy-boto3-dynamodb`. Installing the main `mypy-boto3` meta-package will install stubs for *all* AWS services, which might lead to a larger dependency footprint and potentially slower type-checking for large projects.
fix
Use `pip install mypy-boto3-myservice` for each specific service you need. Alternatively, use `pip install 'mypy-boto3[myservice]'` to explicitly pull in specific service stubs via the meta-package without installing all.
affects: All
Upgrade
Version history
1.43.64latest on PyPI · released Aug 4, 2026
Audit
Dependencies
boto3requiredProvides the runtime objects for which these stubs provide types.
Agent activity
28 hits · last 30 days
node
24
OpenAI (training)
2
Resources
mypy-boto3-dynamodb — pip install mypy-boto3-dynamodb · libregistry