Registry / type-stubs / boto3-stubs-lite

boto3-stubs-lite

JSON →
library1.43.83pypypi✓ verified 22d ago

boto3-stubs-lite provides lightweight type annotations for the boto3 library (version 1.42.88 at time of writing), generated by mypy-boto3-builder. It enhances static analysis for boto3 code without requiring installation of full service-specific stub packages, receiving frequent updates aligned with boto3 and mypy-boto3-builder releases.

pip install boto3-stubs-lite
INSTALL
IMPORT
SIG · BOTO3-STUBS-LITE
B
boto3-stubs-lite
type-stubspythonv1.43.83
Install
4.9s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.83 · 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.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.9s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

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

Session
from boto3_stubs import Session
from boto3_stubs_lite import Session

This quickstart demonstrates basic boto3 client usage. When `boto3-stubs-lite` is installed, type checkers like MyPy will provide type hints and error checking for `session`, `s3_client`, and their methods, even without explicit type imports.

import boto3 import os # boto3-stubs-lite provides type hints for this standard boto3 usage session = boto3.session.Session( aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'), aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET'), region_name=os.environ.get('AWS_REGION', 'us-east-1') ) s3_client = session.client('s3') try: # This call is type-checked by boto3-stubs-lite response = s3_client.list_buckets() print(f"Successfully listed {len(response.get('Buckets', []))} buckets.") except Exception as e: print(f"Error listing buckets: {e}") # Example of using a resource (also typed) # s3_resource = session.resource('s3') # bucket = s3_resource.Bucket('my-example-bucket') # print(f"Bucket name: {bucket.name}")
Debug
Known issues
breakingSupport for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0 (which generates `boto3-stubs-lite`). Users on Python 3.8 will need to upgrade to Python 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or higher.
affects: >=8.12.0
breakingThe `sms-voice` AWS service was removed in `mypy-boto3-builder` version 8.11.0. Its functionality has been replaced by `pinpoint-sms-voice`.
fix
Migrate your code to use the `pinpoint-sms-voice` client instead of `sms-voice`.
affects: >=8.11.0
gotchaboto3-stubs-lite provides 'lite' type annotations. This means complex TypedDicts for request/response parameters might be simplified or represented as `Any`. For comprehensive, service-specific type definitions with full detail, install `mypy-boto3-servicename` packages (e.g., `mypy-boto3-s3`).
fix
If you require detailed TypedDicts and comprehensive type checking for specific AWS services, install the corresponding `mypy-boto3-servicename` package (e.g., `pip install mypy-boto3-s3`) and use its types within `if TYPE_CHECKING:` blocks.
affects: All versions
gotchaAttempting to import types from `mypy_boto3_servicename` (e.g., `from mypy_boto3_s3.client import S3Client`) outside of `if TYPE_CHECKING:` blocks for runtime use will result in `ModuleNotFoundError`, as these modules only contain type stubs, not executable code.
fix
Only import types from `mypy_boto3_*` packages within `if TYPE_CHECKING:` blocks, or rely on `boto3-stubs-lite` to provide the base type information implicitly to your type checker.
affects: All versions
Upgrade
Version history
1.43.83latest on PyPI · released Aug 28, 2026
Audit
Dependencies
boto3requiredProvides type annotations for the boto3 library.
typing-extensionsoptionalRequired for Python versions prior to 3.11 for certain type features.
Agent activity
41 hits · last 30 days
node
34
OpenAI (training)
1
Resources
boto3-stubs-lite — pip install boto3-stubs-lite · libregistry