mypy-boto3
![PyPI - Downloads](https://static.pepy.tech/badge/mypy-boto3
Dynamic
boto3 1.35.70
type annotations builder for
boto3-stubs.
Generated by
mypy-boto3-builder 8.3.1.
More information can be found on
boto3-stubs page.
See how it helps to find and fix potential bugs:
How to install
python -m pip install boto3-stubs
python -m pip install 'boto3-stubs[s3,ec2]'
python -m pip install 'boto3-stubs-lite[s3,ec2]'
Usage
Provides ServiceName
and ResourceServiceName
literals:
from typing import overload
import boto3
from botocore.client import BaseClient
from mypy_boto3.literals import ServiceName
from mypy_boto3_ec2.client import EC2Client
from mypy_boto3_ec2.literals import EC2ServiceName
from mypy_boto3_s3.client import S3Client
from mypy_boto3_s3.literals import S3ServiceName
@overload
def get_client(service_name: EC2ServiceName) -> EC2Client: ...
@overload
def get_client(service_name: S3ServiceName) -> S3Client: ...
@overload
def get_client(service_name: ServiceName) -> BaseClient: ...
def get_client(service_name: ServiceName) -> BaseClient:
return boto3.client(service_name)
s3_client = get_client("s3")
ec2_client = get_client("ec2")
dynamodb_client = get_client("dynamodb")
Latest changes
Full changelog can be found in
Releases.
Versioning
mypy-boto3
version is the same as related boto3
version and follows
PEP 440 format.
Support and contributing
Please reports any bugs or request new features in
mypy_boto3_builder
repository.