{"id":3335,"library":"mypy-boto3-artifact","title":"mypy-boto3-artifact Type Stubs","description":"mypy-boto3-artifact provides a set of type annotations (type stubs) for the `boto3` library's AWS Artifact service, enabling static type checking with tools like MyPy. It is generated using `mypy-boto3-builder` and is currently at version 1.42.13. New versions are released frequently, typically in sync with `boto3` updates and `mypy-boto3-builder` enhancements.","status":"active","version":"1.42.13","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","type-hints","mypy","stubs","artifact","static-analysis"],"install":[{"cmd":"pip install boto3 mypy-boto3-artifact","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"Required at runtime; this package provides only type stubs for boto3's Artifact service.","package":"boto3"},{"reason":"Needed to perform static type checking, which is the primary purpose of this library.","package":"mypy","optional":true}],"imports":[{"symbol":"ArtifactClient","correct":"from mypy_boto3_artifact.client import ArtifactClient"},{"symbol":"ReportSummaryTypeDef","correct":"from mypy_boto3_artifact.type_defs import ReportSummaryTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_artifact.client import ArtifactClient\nfrom mypy_boto3_artifact.type_defs import ReportSummaryTypeDef\nimport os # Used to hint at env vars for auth, though boto3 handles it implicitly\n\ndef list_artifact_reports() -> list[ReportSummaryTypeDef]:\n    # boto3 automatically picks up credentials from environment variables (AWS_ACCESS_KEY_ID, etc.),\n    # ~/.aws/credentials, or IAM roles.\n    client: ArtifactClient = boto3.client(\"artifact\")\n    response = client.list_reports()\n    return response.get(\"reports\", [])\n\nif __name__ == \"__main__\":\n    # For a real application, ensure AWS credentials are configured.\n    # For example, by setting AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY\n    # in your environment.\n\n    print(\"Attempting to list AWS Artifact reports...\")\n    try:\n        reports = list_artifact_reports()\n        if reports:\n            print(f\"Found {len(reports)} artifact reports:\")\n            # Print first 3 reports for brevity\n            for report in reports[:3]:\n                print(f\"  - Name: {report.get('reportName', 'N/A')}, ID: {report.get('reportId', 'N/A')}\")\n        else:\n            print(\"No AWS Artifact reports found or access denied.\")\n    except Exception as e:\n        print(f\"Error listing reports: {e}\")\n        print(\"Please ensure you have valid AWS credentials and appropriate permissions for the 'artifact' service.\")","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-artifact` type stubs with `boto3` to interact with the AWS Artifact service, specifically listing available reports. It leverages type hints for compile-time validation of client methods and response structures."},"warnings":[{"fix":"Upgrade your Python interpreter to version 3.9 or higher.","message":"Starting with `mypy-boto3-builder` version 8.12.0, Python 3.8 support has been removed from all generated stub packages, including `mypy-boto3-artifact`. Ensure your environment uses Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.0 (artifact)"},{"fix":"Review your code for TypeDef names, especially those for request parameters or with `Extra` suffixes, and update them according to the new naming conventions.","message":"In `mypy-boto3-builder` version 8.9.0, there were breaking changes to how TypeDef names are generated. TypeDefs for packed method arguments use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes were moved (`CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). Your existing type hint code might require updates.","severity":"breaking","affected_versions":">=8.9.0 (builder)"},{"fix":"Always install both `boto3` and the corresponding `mypy-boto3-SERVICE_NAME` stub package. For example: `pip install boto3 mypy-boto3-artifact`.","message":"Since `mypy-boto3-builder` version 8.12.0, packages have migrated to PEP 561. This means stub packages like `mypy-boto3-artifact` are installed alongside the runtime library (`boto3`) and do not replace it. MyPy automatically discovers these stubs. You should install both `boto3` and the specific `mypy-boto3-SERVICE_NAME` package.","severity":"gotcha","affected_versions":">=8.12.0 (builder)"},{"fix":"Install `mypy-boto3-SERVICE_NAME` for each AWS service you intend to use type hints with.","message":"`mypy-boto3` uses a separate package for each AWS service. If you need type hints for multiple services (e.g., S3 and Artifact), you must install each corresponding stub package (e.g., `mypy-boto3-s3` and `mypy-boto3-artifact`). There is no single `mypy-boto3` package that includes all service stubs.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}