{"id":3094,"library":"mypy-boto3-glacier","title":"mypy-boto3-glacier Type Stubs","description":"mypy-boto3-glacier provides a complete set of type annotations (stubs) for the AWS Boto3 Glacier service. These stubs enhance developer experience by enabling static type checking with tools like mypy, and providing improved autocomplete in IDEs for Glacier client, resource, paginator, waiter, and type definitions. It is generated by the `mypy-boto3-builder` project and is currently at version 1.42.30, reflecting a close alignment with `boto3`'s release cycle, ensuring frequent updates for new AWS features and API changes.","status":"active","version":"1.42.30","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","glacier","stubs"],"install":[{"cmd":"pip install mypy-boto3-glacier","lang":"bash","label":"Install standalone stubs"},{"cmd":"pip install 'boto3-stubs[glacier]'","lang":"bash","label":"Install as part of boto3-stubs (recommended)"}],"dependencies":[{"reason":"Provides the underlying AWS SDK for Python, which these stubs type-annotate.","package":"boto3","optional":false},{"reason":"May be implicitly required for full type-hinting compatibility on Python versions older than 3.9, due to the migration to `collections.abc` with fallbacks.","package":"typing-extensions","optional":true}],"imports":[{"note":"GlacierClient is provided by the type stub package, not directly from boto3.","wrong":"from boto3.client import GlacierClient","symbol":"GlacierClient","correct":"from mypy_boto3_glacier.client import GlacierClient"},{"note":"Used for type-hinting the Glacier service resource.","symbol":"GlacierServiceResource","correct":"from mypy_boto3_glacier.service_resource import GlacierServiceResource"},{"note":"All generated TypedDicts reside in the `type_defs` submodule.","symbol":"ArchiveInformationTypeDef","correct":"from mypy_boto3_glacier.type_defs import ArchiveInformationTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_glacier.client import GlacierClient\nfrom mypy_boto3_glacier.type_defs import CreateVaultOutputTypeDef\nimport os\n\ndef get_glacier_client() -> GlacierClient:\n    # Using explicit type annotation for better IDE support and static analysis\n    client: GlacierClient = boto3.client(\n        \"glacier\",\n        region_name=os.environ.get('AWS_REGION', 'us-east-1'),\n        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),\n        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', '')\n    )\n    return client\n\ndef create_glacier_vault(client: GlacierClient, vault_name: str) -> CreateVaultOutputTypeDef:\n    response: CreateVaultOutputTypeDef = client.create_vault(vaultName=vault_name)\n    return response\n\nif __name__ == '__main__':\n    glacier_client = get_glacier_client()\n    # Example of type-hinted usage\n    try:\n        vault_info = create_glacier_vault(glacier_client, \"my-typed-vault\")\n        print(f\"Vault created: {vault_info.get('location')}\")\n    except glacier_client.exceptions.ResourceAlreadyExistsException:\n        print(\"Vault already exists.\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted Glacier client using `mypy-boto3-glacier` and perform a basic operation like creating a vault. Explicit type annotations on `boto3.client` calls enable full type checking and IDE autocomplete."},"warnings":[{"fix":"Upgrade Python to 3.9+ or pin `mypy-boto3-glacier` to `<1.42.0` (or the last version compatible with builder <8.12.0).","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. Projects using Python 3.8 will need to upgrade their Python version or pin `mypy-boto3-glacier` to a version prior to 8.12.0.","severity":"breaking","affected_versions":">=8.12.0 (builder), affects all generated packages including mypy-boto3-glacier"},{"fix":"Ensure `mypy` is configured to find site-packages. For non-standard setups, verify that type checkers can locate the `py.typed` marker file or explicitly configure `MYPYPATH` if necessary (though stub-only packages prefer installation).","message":"The project migrated to PEP 561 packages in `mypy-boto3-builder` version 8.12.0. This change improves how type checkers like mypy discover and utilize stub files, but might require updates to custom build scripts or environments not adhering to standard package installation practices.","severity":"breaking","affected_versions":">=8.12.0 (builder), affects all generated packages"},{"fix":"Review and update `TypeDef` imports and usage in your code to reflect the new, shorter naming conventions after upgrading.","message":"Starting with `mypy-boto3-builder` 8.9.0, there were breaking changes in how TypeDefs for packed method arguments are named, e.g., `CreateDistributionRequestRequestTypeDef` was shortened to `CreateDistributionRequestTypeDef`. While the example is for another service, this change affects all generated `TypeDef`s across services.","severity":"breaking","affected_versions":">=8.9.0 (builder), affects all generated packages"},{"fix":"Always use explicit type annotations for `boto3.client` and `boto3.resource` assignments. (e.g., `client: GlacierClient = session.client(\"glacier\")`).","message":"When using `mypy-boto3-glacier` or `boto3-stubs`, it is often necessary to explicitly annotate the return type of `boto3.client()` calls (e.g., `client: GlacierClient = boto3.client(...)`) for optimal IDE autocomplete and static analysis, especially in VSCode.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Migrate from `mypy-boto3` to `boto3-stubs` or individual service stubs like `mypy-boto3-glacier` for current compatibility and features.","message":"The `mypy-boto3` project (the original name) was moved to a separate product and is no longer generated alongside `boto3-stubs` since `mypy-boto3-builder` 8.9.0. Users upgrading from very old `mypy-boto3` installations might need to switch to `boto3-stubs` or `mypy-boto3-glacier` directly.","severity":"gotcha","affected_versions":"Versions before 8.9.0 for `mypy-boto3`"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}