{"id":616,"library":"boto3-stubs","title":"boto3-stubs Type Annotations for AWS SDK for Python","description":"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.","status":"active","version":"1.42.78","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","type-checking","mypy","stubs","cloud"],"install":[{"cmd":"pip install boto3-stubs","lang":"bash","label":"Install all stubs"},{"cmd":"pip install 'boto3-stubs[s3]'","lang":"bash","label":"Install stubs for a specific service (e.g., S3)"},{"cmd":"pip install 'boto3-stubs[essential]'","lang":"bash","label":"Install stubs for essential services (CloudFormation, DynamoDB, EC2, Lambda, RDS, S3, SQS)"},{"cmd":"pip install boto3-stubs-lite","lang":"bash","label":"Install lite version (less RAM, explicit annotations required)"}],"dependencies":[{"reason":"Provides the underlying AWS SDK; boto3-stubs only adds type annotations.","package":"boto3","optional":false},{"reason":"Requires Python 3.9 or higher as of version 8.12.0 of mypy-boto3-builder.","package":"python","optional":false},{"reason":"A static type checker to leverage the provided type annotations.","package":"mypy","optional":true},{"reason":"Another static type checker for leveraging type annotations, often used with VSCode.","package":"pyright","optional":true}],"imports":[{"wrong":"import boto3-stubs","symbol":"boto3","correct":"import boto3"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_s3.client import S3Client\nimport os\n\ndef list_s3_buckets(region_name: str = os.environ.get('AWS_REGION', 'us-east-1')) -> list[str]:\n    \"\"\"Lists S3 bucket names with type hints.\"\"\"\n    # boto3-stubs automatically provides type hints for client() and resource() calls\n    s3_client: S3Client = boto3.client(\"s3\", region_name=region_name)\n    response = s3_client.list_buckets()\n    bucket_names = [bucket['Name'] for bucket in response.get('Buckets', [])]\n    return bucket_names\n\nif __name__ == \"__main__\":\n    print(f\"S3 Buckets: {list_s3_buckets()}\")","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Dropped 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.","severity":"breaking","affected_versions":">=8.12.0"},{"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.","message":"Migration to PEP 561 packages. This changes how stubs are packaged and distributed, potentially affecting build systems or direct imports from stub packages.","severity":"breaking","affected_versions":">=8.12.0"},{"fix":"Update your code to use the `pinpoint-sms-voice` service and its corresponding types where applicable.","message":"Service `sms-voice` was removed and replaced by `pinpoint-sms-voice`. If you were using `sms-voice` types, they are no longer generated.","severity":"breaking","affected_versions":">=8.11.0"},{"fix":"Update explicit TypeDef references in your code to match the new naming conventions.","message":"TypeDef naming conventions changed for packed method arguments and conflicting names. TypeDefs like `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`, and `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`.","severity":"breaking","affected_versions":">=8.9.0"},{"fix":"Ensure `pip install boto3` is part of your project's dependency management.","message":"This 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider installing `boto3-stubs-lite` (`pip install boto3-stubs-lite`) or configure PyCharm to use MyPy/PyRight as the primary type checker.","message":"PyCharm'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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'activ':51 'align':57 'annot':5,17 'auto':39 'auto-complet':38 'aw':7,21,67,71 'boto3':2,12,20,47,59,72 'boto3-stubs':1,11 'builder':48 'check':28,75 'cloud':78 'compat':63 'complet':40 'comprehens':15 'enabl':25 'enhanc':36 'ensur':62 'featur':70 'frequent':54 'generat':43 'ide':37 'latest':66 'like':31 'maintain':52 'mypi':32,46,76 'mypy-boto3-builder':45 'provid':14 'pyright':34 'python':10,24 'releas':60 'sdk':8,22 'servic':68 'static':26 'stub':3,13,77 'tool':30 'type':4,16,27,74 'type-check':73 'typic':56 'updat':55","created_at":"2026-03-28T17:07:23.434358+00:00","updated_at":"2026-04-16T00:41:49.500073+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'boto3'"},"ecosystem":"pypi","meta_description":null,"install_score":0,"quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"1.43.81","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/youtype/mypy_boto3_builder","docs":"https://youtype.github.io/boto3_stubs_docs/","changelog":null,"pypi":"https://pypi.org/project/boto3-stubs/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-27","next_check":"2026-07-10","install_tag":"stale"}}