Registry / type-stubs / boto3-stubs

boto3-stubs

JSON →
library1.43.81pypypi✓ verified 24d ago

boto3-stubs provides comprehensive type annotations for the `boto3` AWS SDK for Python, enabling static type checking with tools like MyPy and PyRight, and enhancing IDE auto-completion. It is generated by `mypy-boto3-builder` and is actively maintained with frequent updates, typically aligning with `boto3` releases to ensure compatibility with the latest AWS services and features.

pip install boto3-stubs
INSTALL
IMPORT
SIG · BOTO3-STUBS
B
boto3-stubs
type-stubspythonv1.43.81
Install
5.4s avg
Import
Disk
48MB
Pass rate
10/ 10
Env Coverage10 / 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
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 67.5MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 5.4s · import 0.000s · 32MB
48MB installed
● package 48MB
Code
Verified usage

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

boto3
import boto3
import boto3-stubs

This quickstart demonstrates how to use `boto3-stubs` to add type annotations to `boto3` client calls. By installing `boto3-stubs` (or `boto3-stubs[s3]` for S3 specific stubs), type checkers like MyPy will understand the return types and argument types of `boto3.client('s3')`, and IDEs will provide better auto-completion. Explicitly importing `S3Client` from `mypy_boto3_s3.client` allows for clear type hinting of the client object itself.

import boto3 from mypy_boto3_s3.client import S3Client import os def list_s3_buckets(region_name: str = os.environ.get('AWS_REGION', 'us-east-1')) -> list[str]: """Lists S3 bucket names with type hints.""" # boto3-stubs automatically provides type hints for client() and resource() calls s3_client: S3Client = boto3.client("s3", region_name=region_name) response = s3_client.list_buckets() bucket_names = [bucket['Name'] for bucket in response.get('Buckets', [])] return bucket_names if __name__ == "__main__": print(f"S3 Buckets: {list_s3_buckets()}")
Debug
Known issues
breakingDropped Python 3.8 support. As of `mypy-boto3-builder` version 8.12.0, Python 3.8 is no longer supported for any `boto3-stubs` packages. Projects must use Python 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or newer.
affects: >=8.12.0
breakingMigration to PEP 561 packages. This changes how stubs are packaged and distributed, potentially affecting build systems or direct imports from stub packages.
fix
Ensure your project's `pyproject.toml` or `setup.py` correctly references PEP 561-compliant stub packages. Re-evaluate any custom build or packaging logic that interacts directly with stub files.
affects: >=8.12.0
breakingService `sms-voice` was removed and replaced by `pinpoint-sms-voice`. If you were using `sms-voice` types, they are no longer generated.
fix
Update your code to use the `pinpoint-sms-voice` service and its corresponding types where applicable.
affects: >=8.11.0
breakingTypeDef naming conventions changed for packed method arguments and conflicting names. TypeDefs like `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`, and `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`.
fix
Update explicit TypeDef references in your code to match the new naming conventions.
affects: >=8.9.0
gotchaThis library only provides type annotations. You must still install `boto3` (and `botocore`) for your code to actually run. `boto3-stubs` does not include the AWS SDK itself.
fix
Ensure `pip install boto3` is part of your project's dependency management.
affects: All versions
gotchaPyCharm's performance can be slow with `Literal` overloads. It is recommended to use `boto3-stubs-lite` or external type checkers (MyPy/PyRight) if you experience high CPU usage or slow performance in PyCharm.
fix
Consider installing `boto3-stubs-lite` (`pip install boto3-stubs-lite`) or configure PyCharm to use MyPy/PyRight as the primary type checker.
affects: All versions
Upgrade
Version history
1.43.81latest on PyPI · released Aug 26, 2026
Audit
Dependencies
boto3requiredProvides the underlying AWS SDK; boto3-stubs only adds type annotations.
pythonrequiredRequires Python 3.9 or higher as of version 8.12.0 of mypy-boto3-builder.
mypyoptionalA static type checker to leverage the provided type annotations.
pyrightoptionalAnother static type checker for leveraging type annotations, often used with VSCode.
Agent activity
46 hits · last 30 days
node
38
OpenAI (training)
1
Resources