Type annotations for boto3 1.34.24 master module generated with mypy-boto3-builder 7.23.1
Project description
mypy-boto3
Dynamic boto3 1.34.24 type annotations builder for boto3-stubs.
Generated by mypy-boto3-builder 7.23.1.
More information can be found on boto3-stubs page.
See how it helps to find and fix potential bugs:
How to install
# Install this package
python -m pip install mypy-boto3
# Install type annotations for boto3 services you use
python -m pip install 'boto3-stubs[s3,ec2]'
# Lite version does not provide session.client/resource overloads
# it is more RAM-friendly, but requires explicit type annotations
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)
# type: S3Client, fully type annotated
# All methods and attributes are auto-completed and type checked
s3_client = get_client("s3")
# type: EC2Client, fully type annotated
# All methods and attributes are auto-completed and type checked
ec2_client = get_client("ec2")
# type: BaseClient, only basic type annotations
# Dynamodb-specific methods and attributes are not auto-completed and not type checked
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.
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
mypy-boto3-1.34.24.tar.gz
(21.2 kB
view hashes)
Built Distribution
Close
Hashes for mypy_boto3-1.34.24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 814893631a1127684469082a4937f7377c53310819fc46e8a072499bccab6c0b |
|
MD5 | 904663e242164e8edea4136b8a69dfb0 |
|
BLAKE2b-256 | 78fe16ae57426a41c739910bb0bf396102634cd9304ea0b74df3ff0d687380f4 |