Type annotations for boto3.DynamoDB 1.13.26 service, generated by mypy-boto3-buider 2.0.4
Project description
mypy-boto3-dynamodb
Type annotations for boto3.DynamoDB 1.13.26 service compatible with mypy, VSCode, PyCharm and other tools.
Generated by mypy-boto3-buider 2.0.4.
More information can be found on boto3-stubs page.
How to use
Make sure you have mypy installed and activated in your IDE.
Install boto3-stubs
for DynamoDB
service.
python -m pip install boto3-stubs[dynamodb]
Use boto3
with mypy_boto3_dynamodb
in your project and enjoy type checking and auto-complete.
import boto3
from mypy_boto3_dynamodb import DynamoDBClient
# Now mypy can check if your code is valid.
client: DynamoDBClient = boto3.client("dynamodb")
# works for session as well
session = boto3.session.Session(region="us-west-1")
session_client: DynamoDBClient = session.client("dynamodb")
# Do you prefer resource approach? We've got you covered!
from mypy_boto3_dynamodb import DynamoDBServiceResource
resource: dynamodb.DynamoDBServiceResource = boto3.resource("dynamodb")
# Waiters are also supported
import mypy_boto3_dynamodb.waiter as dynamodb_waiters
table_exists_waiter: dynamodb_waiters.TableExistsWaiter = client.get_waiter("table_exists")
table_not_exists_waiter: dynamodb_waiters.TableNotExistsWaiter = client.get_waiter("table_not_exists")
# Annotated paginators are included as well
import mypy_boto3_dynamodb.paginator as dynamodb_paginators
list_backups_paginator: dynamodb_paginators.ListBackupsPaginator = client.get_paginator("list_backups")
list_tables_paginator: dynamodb_paginators.ListTablesPaginator = client.get_paginator("list_tables")
list_tags_of_resource_paginator: dynamodb_paginators.ListTagsOfResourcePaginator = client.get_paginator("list_tags_of_resource")
query_paginator: dynamodb_paginators.QueryPaginator = client.get_paginator("query")
scan_paginator: dynamodb_paginators.ScanPaginator = client.get_paginator("scan")
Dynamic type annotations
mypy_boto3
command generates boto3.client/resource
type annotations for
mypy_boto3_dynamodb
and other installed services.
# Run this command after you add or remove service packages
python -m mypy_boto3
Generated type annotations provide overloads for boto3.client
and boto3.resource
,
boto3.Session.client
and boto3.Session.resource
functions,
so explicit type annotations are not needed.
mypy
supports function overloads as expectedPyCharm
also supports function overloads, but consumes a lot of RAM, use carefully if you have many services installedVSCode
does not currently support function overloads, use explicit type annotations
import boto3
# Type is discovered correctly by mypy and PyCharm
# VSCode still needs explicit type annotations
client = boto3.client("dynamodb")
resource = boto3.resource("dynamodb")
session_client = boto3.Session().client("dynamodb")
session_resource = boto3.Session().resource("dynamodb")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mypy-boto3-dynamodb-1.13.26.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3df776a3336af8a957b0b724eeb7c6a1a44f4c9888a22f82be9baee6150e602 |
|
MD5 | 08742b8c27c26c5020969c9dc30bf6fe |
|
BLAKE2b-256 | 5ef5b3b0b512f587f8a0ac47d28b7b79a9edfce79bf70b4a5e645fc6d5b06f1b |
Hashes for mypy_boto3_dynamodb-1.13.26.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4cb05fecbfacc158caf9012832206aed9369f1f5e4bb5168c0f68c82afc22fd |
|
MD5 | 686115c64dafdfd1b784b81d54c660df |
|
BLAKE2b-256 | 6db4d415cf9c03234b8efaa1b00e26f6f34952f693abbe9b4fe8bd676c5d597e |