{"id":5667,"library":"mypy-boto3","title":"mypy-boto3 (Legacy Boto3 Type Stubs)","description":"This package provides legacy type annotations for the `boto3` AWS SDK. As of version `1.42.3`, it is officially deprecated in favor of `types-boto3`. It enhances `boto3` code with static type checking capabilities (e.g., with MyPy) by providing a single package with stubs for all AWS services. The recommended successor, `types-boto3`, offers more granular, service-specific stub packages and is actively maintained.","status":"deprecated","version":"1.42.3","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","mypy","type-hints","stubs","legacy","deprecated"],"install":[{"cmd":"pip install mypy-boto3 boto3","lang":"bash","label":"Legacy installation (Deprecated)"},{"cmd":"pip install 'types-boto3[all]' boto3","lang":"bash","label":"Recommended alternative for all services"},{"cmd":"pip install 'types-boto3[s3,lambda]' boto3","lang":"bash","label":"Recommended alternative for specific services (best practice)"}],"dependencies":[{"reason":"Runtime dependency for type stubs; mypy-boto3 provides types for boto3.","package":"boto3","optional":false}],"imports":[{"note":"mypy-boto3 is a stub package and not directly imported. Its presence enables type checking for standard boto3 imports.","symbol":"boto3.client","correct":"import boto3\n\ns3_client = boto3.client('s3')"}],"quickstart":{"code":"import boto3\nfrom typing import Optional\n\ndef get_s3_bucket_location(bucket_name: str) -> Optional[str]:\n    s3_client = boto3.client('s3')\n    # The response type from get_bucket_location will be fully type-hinted\n    response = s3_client.get_bucket_location(Bucket=bucket_name)\n    location = response.get('LocationConstraint')\n    return location\n\n# Example usage (requires AWS credentials configured and bucket to exist)\n# try:\n#     # For a bucket like 'your-unique-test-bucket-123'\n#     location = get_s3_bucket_location('your-unique-test-bucket-123')\n#     if location is not None:\n#         print(f\"Bucket location: {location}\")\n#     else:\n#         print(\"Bucket location is 'us-east-1' (default) or not set.\")\n# except Exception as e:\n#     print(f\"Error fetching bucket location: {e}\")","lang":"python","description":"This quickstart demonstrates how `mypy-boto3` (or its successor `types-boto3`) enhances standard `boto3` usage with type annotations. Installing the stubs allows static analysis tools like MyPy and IDEs to provide accurate type information, autocomplete, and error checking for `boto3` client methods and their responses."},"warnings":[{"fix":"Uninstall `mypy-boto3` (`pip uninstall mypy-boto3`). Install `types-boto3` or specific service packages (e.g., `pip install types-boto3-s3`). Refer to `types-boto3` documentation for details.","message":"The `mypy-boto3` package is officially deprecated and no longer actively maintained. Users are strongly advised to migrate to `types-boto3` and its service-specific sub-packages for current features, bug fixes, and active support.","severity":"breaking","affected_versions":"1.x.x (all versions of mypy-boto3)"},{"fix":"Identify the specific AWS services your project uses and install only the corresponding `types-boto3-<service>` packages (e.g., `pip install types-boto3-s3 types-boto3-lambda`) or `pip install 'types-boto3[all]'` if all stubs are needed.","message":"Unlike `mypy-boto3`, which provided all service stubs in a single package, `types-boto3` promotes a modular approach with separate packages for each AWS service (e.g., `types-boto3-s3`, `types-boto3-lambda`). This reduces dependency footprint and improves type checking performance but requires installing each service individually or using the `[all]` extra.","severity":"gotcha","affected_versions":"1.x.x (mypy-boto3 users migrating to types-boto3)"},{"fix":"Upgrade your Python environment to 3.9 or a newer version to maintain compatibility with the actively maintained `types-boto3` package line.","message":"While `mypy-boto3` version 1.x.x itself requires Python `3.9` or newer, the successor `types-boto3` versions (8.12.0+) have explicitly dropped support for Python 3.8. Ensure your development and deployment environments are running Python 3.9 or newer to be compatible with `types-boto3`.","severity":"gotcha","affected_versions":"1.x.x (mypy-boto3 users considering or undergoing migration)"}],"env_vars":null,"search_vec":"'1.42.3':22 'activ':72 'annot':13 'aw':17,54,75 'boto3':3,5,16,32,35,61,74 'capabl':41 'check':40 'code':36 'deprec':26,82 'e.g':42 'enhanc':34 'favor':28 'granular':64 'hint':79 'legaci':4,11,81 'maintain':73 'mypi':2,44,76 'mypy-boto3':1 'offer':62 'offici':25 'packag':9,49,69 'provid':10,46 'recommend':57 'sdk':18 'servic':55,66 'service-specif':65 'singl':48 'specif':67 'static':38 'stub':7,51,68,80 'successor':58 'type':6,12,31,39,60,78 'type-hint':77 'types-boto3':30,59 'version':21","created_at":"2026-04-14T03:38:34.271473+00:00","updated_at":"2026-04-17T13:58:33.124356+00:00","problems":{"verify_error":"error: Failed to parse: `mypy-boto3 boto3`\n  Caused by: Expected one of `@`, `(`, `<`, `=`, `>`, `~`, `!`, `;`, found `b`\nmypy-boto3 boto3\n           ^"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.0","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/mypy-boto3/","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-06-28","last_verified":"2026-08-30","next_check":"2026-07-05","install_tag":null}}