Skip to main content

Legacy type annotations for boto3, use types-boto3 instead.

Project description

mypy-boto3

PyPI - mypy-boto3 PyPI - Python Version Docs ![PyPI - Downloads](https://static.pepy.tech/badge/mypy-boto3

boto3.typed

Dynamic boto3 1.42.3

Generated with mypy-boto3-builder 8.12.0.

More information can be found on types-boto3 page.

See how it helps to find and fix potential bugs:

types-boto3 demo

How to install

# Install this package
python -m pip install types-boto3

# Install type annotations for boto3 services you use
python -m pip install 'types-boto3[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 'types-boto3-lite[s3,ec2]'

Usage

Provides ServiceName and ResourceServiceName literals:

from typing import overload

import boto3
from botocore.client import BaseClient
from types_boto3.literals import ServiceName
from types_boto3_ec2.client import EC2Client
from types_boto3_ec2.literals import EC2ServiceName
from types_boto3_s3.client import S3Client
from types_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 Python Packaging version specifiers.

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.42.3.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mypy_boto3-1.42.3-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file mypy_boto3-1.42.3.tar.gz.

File metadata

  • Download URL: mypy_boto3-1.42.3.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for mypy_boto3-1.42.3.tar.gz
Algorithm Hash digest
SHA256 19d6fda488de5077ab6f4d7a482a814329557edc7c6e6eac917c69e00371710d
MD5 51919de3d79c884c00fde8e528998189
BLAKE2b-256 ea4277c5c812edf4e92dcce1d4ee9c055eccb70392faef05145c2fad1970cb60

See more details on using hashes here.

File details

Details for the file mypy_boto3-1.42.3-py3-none-any.whl.

File metadata

  • Download URL: mypy_boto3-1.42.3-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for mypy_boto3-1.42.3-py3-none-any.whl
Algorithm Hash digest
SHA256 783cee49a25f383aa9009660882b355ebc656ea65c626daebf63bf83265cefea
MD5 1d923a02f7a1ea391096c1b6614e0d2c
BLAKE2b-256 5475dba6de4cb277be8ba84c637502890d9071806f3d55801b67f55e348a3cd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page