Type annotations for boto3.DynamoDB 1.14.0 service, generated by mypy-boto3-buider 2.0.4
Project description
mypy-boto3-dynamodb
Type annotations for boto3.DynamoDB 1.14.0 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.14.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f26d5508253556f964177843621c7f7e19ef09ec5bc04e06c618a4e56c716e36 |
|
MD5 | d63ad1de1b8755d5356a80e7a9781830 |
|
BLAKE2b-256 | 4088ffad90a3ba708c2dc91388a417ea599da06d613e5f66ce20ea730fcb4d67 |
Hashes for mypy_boto3_dynamodb-1.14.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 094431926b09583b42abb47bab6ab93d1537789d6163a4fc9dfa802e07a55022 |
|
MD5 | 0f3f9bc69eced59a2c1ab18fb13ea5e6 |
|
BLAKE2b-256 | 69e301b8ee7918cbbfb237ffa348984ed2d37c739f8f21c8f6b688a1f378d7dd |