{"id":4458,"library":"boto3-stubs-lite","title":"boto3-stubs-lite","description":"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.","status":"active","version":"1.42.88","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","type hints","mypy","static analysis","cloud"],"install":[{"cmd":"pip install boto3-stubs-lite","lang":"bash","label":"Install core stubs"}],"dependencies":[{"reason":"Provides type annotations for the boto3 library.","package":"boto3","optional":false},{"reason":"Required for Python versions prior to 3.11 for certain type features.","package":"typing-extensions","optional":true}],"imports":[{"wrong":"from boto3_stubs_lite import Session","symbol":"Session","correct":"from boto3_stubs import Session"}],"quickstart":{"code":"import boto3\nimport os\n\n# boto3-stubs-lite provides type hints for this standard boto3 usage\nsession = boto3.session.Session(\n    aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'),\n    aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET'),\n    region_name=os.environ.get('AWS_REGION', 'us-east-1')\n)\n\ns3_client = session.client('s3')\n\ntry:\n    # This call is type-checked by boto3-stubs-lite\n    response = s3_client.list_buckets()\n    print(f\"Successfully listed {len(response.get('Buckets', []))} buckets.\")\nexcept Exception as e:\n    print(f\"Error listing buckets: {e}\")\n\n# Example of using a resource (also typed)\n# s3_resource = session.resource('s3')\n# bucket = s3_resource.Bucket('my-example-bucket')\n# print(f\"Bucket name: {bucket.name}\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Support 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.","severity":"breaking","affected_versions":">=8.12.0"},{"fix":"Migrate your code to use the `pinpoint-sms-voice` client instead of `sms-voice`.","message":"The `sms-voice` AWS service was removed in `mypy-boto3-builder` version 8.11.0. Its functionality has been replaced by `pinpoint-sms-voice`.","severity":"breaking","affected_versions":">=8.11.0"},{"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.","message":"boto3-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`).","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Attempting 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'1.42.88':18 'align':49 'analysi':32,64 'annot':12 'aw':58 'boto3':2,6,15,27,34,51,55,59 'boto3-stubs-lite':1,5 'builder':28,56 'cloud':65 'code':35 'enhanc':30 'frequent':47 'full':40 'generat':23 'hint':61 'instal':38 'librari':16 'lightweight':10 'lite':4,8 'mypi':26,54,62 'mypy-boto3-builder':25,53 'packag':45 'provid':9 'receiv':46 'releas':57 'requir':37 'servic':42 'service-specif':41 'specif':43 'static':31,63 'stub':3,7,44 'time':20 'type':11,60 'updat':48 'version':17 'without':36 'write':22","created_at":"2026-04-12T13:53:31.335431+00:00","updated_at":"2026-04-16T00:43:02.522773+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'boto3_stubs'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.83","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-lite/","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-29","next_check":"2026-07-10","install_tag":null}}