Registry / type-stubs / types-boto3

types-boto3

JSON →
library1.43.81pypypi✓ verified 26d ago

types-boto3 provides comprehensive type annotations for the boto3, botocore, aiobotocore, and aioboto3 libraries. It significantly enhances development experience by enabling static type checking and providing intelligent code completion in IDEs like PyCharm and VSCode for AWS SDK for Python. The library is actively maintained and regularly updated to reflect the latest boto3 versions.

pip install types-boto3
INSTALL
IMPORT
SIG · TYPES-BOTO3
T
types-boto3
type-stubspythonv1.43.81
Install
19.2s avg
Import
Disk
98MB
Pass rate
9/ 10
Env Coverage9 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.81 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 26.6s
py 3.11
✓ 0.03s
2/3 runs
py 3.12
✓ —
✓ 29.33s
py 3.13
✓ —
✓ 11.4s
py 3.9
✓ —
✓ 28.4s
98MB installed
● package 98MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

S3Client
from boto3-stubs.s3.client import S3Client
from boto3_stubs.s3.client import S3Client

This quickstart demonstrates how to use type annotations for a boto3 S3 client. It explicitly imports the `S3Client` type from `types_boto3_s3.client` and `ListBucketsOutputTypeDef` for the response, enabling IDEs to provide code completion and static type checkers like MyPy to validate usage. Ensure `boto3` and `types-boto3[s3]` are installed.

import boto3 from types_boto3_s3.client import S3Client from types_boto3_s3.type_defs import ListBucketsOutputTypeDef def list_s3_buckets_typed() -> ListBucketsOutputTypeDef: s3_client: S3Client = boto3.client('s3') response: ListBucketsOutputTypeDef = s3_client.list_buckets() for bucket in response.get('Buckets', []): print(f"Bucket Name: {bucket.get('Name')}, Creation Date: {bucket.get('CreationDate')}") return response if __name__ == '__main__': # This assumes AWS credentials are configured (e.g., via ~/.aws/credentials or env vars) try: print("Listing S3 buckets with type hints:") list_s3_buckets_typed() except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
breakingThe `boto3-type-annotations` library, version 0.3.1 and earlier, is deprecated and no longer maintained. Its import paths and structure are different from the current `types-boto3` package.
fix
Migrate to `types-boto3`. Replace `pip install boto3-type-annotations` with `pip install types-boto3` (or specific service extras) and update import statements (e.g., `from boto3_type_annotations.s3 import Client` to `from types_boto3_s3.client import S3Client`).
affects: <=0.3.1 (boto3-type-annotations)
breakingThe `boto3-stubs` library has been superseded by `types-boto3`. While largely similar, users should migrate to the `types-boto3` package for continued updates and features.
fix
Replace `boto3-stubs` dependency with `types-boto3`. Update `mypy_boto3_<service>` imports to `types_boto3_<service>` (e.g., `from mypy_boto3_s3.client import S3Client` to `from types_boto3_s3.client import S3Client`).
affects: All `boto3-stubs` versions
gotchaPyCharm users might experience slow performance with `Literal` overloads, which are used extensively in `types-boto3` for enum-like parameters.
fix
It is recommended to use `types-boto3-lite` instead of `types-boto3` if PyCharm performance becomes an issue, especially with older PyCharm versions (before the underlying issue PY-40997 is fully resolved). `pip install types-boto3-lite`.
affects: All versions (PyCharm specific)
gotchaFor optimal performance and to reduce package size, it's recommended to install type annotations only for the specific AWS services you use, rather than the `[all]` extra.
fix
Instead of `pip install 'types-boto3[all]'`, install specific service packages like `pip install 'types-boto3[s3,ec2]'`. Each service has its own dedicated package (e.g., `types-boto3-s3`).
affects: All versions
Upgrade
Version history
1.43.81latest on PyPI · released Aug 26, 2026
Audit
Dependencies
boto3requiredProvides the underlying AWS SDK for Python, which these type annotations describe.
Agent activity
34 hits · last 30 days
node
30
OpenAI (training)
1
Resources
types-boto3 — pip install types-boto3 · libregistry