{"id":3587,"library":"mypy-boto3-importexport","title":"mypy-boto3-importexport","description":"mypy-boto3-importexport provides type annotations for the AWS SDK for Python (boto3) ImportExport service. These type stubs enhance code completion, static analysis, and error detection for boto3 usage with tools like mypy, PyCharm, and VSCode. It is automatically generated by mypy-boto3-builder and is regularly updated to stay in sync with new boto3 releases and AWS API changes.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","stubs","importexport","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-importexport","lang":"bash","label":"Install service-specific stubs"},{"cmd":"pip install 'boto3-stubs[importexport]' # Recommended for broader boto3 stub coverage","lang":"bash","label":"Install as part of boto3-stubs"},{"cmd":"pip install boto3","lang":"bash","label":"Install runtime dependency"}],"dependencies":[{"reason":"Runtime dependency for actual AWS API calls. This package only provides type stubs.","package":"boto3","optional":false},{"reason":"Required for older Python versions (pre-3.9) for full type-hinting support. Included automatically if needed.","package":"typing-extensions","optional":true}],"imports":[{"note":"Main client type for the ImportExport service.","symbol":"ImportExportClient","correct":"from mypy_boto3_importexport import ImportExportClient"},{"note":"Example of importing a service-specific TypeDef for precise response typing.","symbol":"ArtifactTypeDef","correct":"from mypy_boto3_importexport.type_defs import ArtifactTypeDef"},{"note":"Importing a paginator type for type-checking pagination results.","symbol":"ListJobsPaginator","correct":"from mypy_boto3_importexport.paginator import ListJobsPaginator"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_importexport import ImportExportClient\nfrom mypy_boto3_importexport.type_defs import JobTypeDef, ArtifactTypeDef\n\n\ndef get_import_export_client() -> ImportExportClient:\n    \"\"\"Returns a typed ImportExport client.\"\"\"\n    # Actual credentials will be picked up by boto3 from environment variables or AWS config\n    session = boto3.Session(region_name=\"us-east-1\")\n    return session.client(\"importexport\")\n\n\ndef list_jobs(client: ImportExportClient) -> list[JobTypeDef]:\n    \"\"\"Lists ImportExport jobs.\"\"\"\n    response = client.list_jobs(MaxJobs=5)\n    return response.get(\"Jobs\", [])\n\n\nif __name__ == \"__main__\":\n    client = get_import_export_client()\n    jobs = list_jobs(client)\n    if jobs:\n        print(f\"Found {len(jobs)} ImportExport jobs:\")\n        for job in jobs:\n            print(f\"  Job ID: {job.get('JobId')}, Type: {job.get('JobType')}, Status: {job.get('JobStatus')}\")\n    else:\n        print(\"No ImportExport jobs found.\")","lang":"python","description":"This example demonstrates how to initialize a typed `ImportExportClient` and use it to list jobs with proper type annotations, enabling static analysis and IDE auto-completion. It explicitly types the client and uses `JobTypeDef` for response typing. Remember to have AWS credentials configured (e.g., via environment variables or `~/.aws/credentials`)."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer, or pin `mypy-boto3-importexport` to a compatible older version (e.g., <1.42.3).","message":"Python 3.8 support has been removed. `mypy-boto3-builder` versions 8.12.0 and newer (which generate `mypy-boto3-importexport 1.42.3` and later) require Python 3.9 or higher. Projects on Python 3.8 must use older `mypy-boto3-importexport` versions or upgrade Python.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0, mypy-boto3-importexport >= 1.42.3"},{"fix":"Ensure your `mypy` configuration is up-to-date and correctly identifies installed stub packages. Most standard `mypy` setups should automatically discover PEP 561 packages.","message":"The `mypy-boto3-builder` migrated to PEP 561 compliant packages with version 8.12.0. This standardizes how type stubs are distributed and discovered. While generally a positive change, it might affect custom `mypy` configurations or build systems that relied on older stub discovery mechanisms.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0, mypy-boto3-importexport >= 1.42.3"},{"fix":"Review `TypeDef` imports and usage in your code after upgrading `mypy-boto3` libraries. Consult service-specific documentation for updated `TypeDef` names.","message":"Breaking changes to `TypeDef` naming conventions (e.g., removing redundant `Request` suffixes or changing `Extra` placement) were introduced in `mypy-boto3-builder 8.9.0`. While `importexport` might not be directly affected, other services could see altered `TypedDict` names, potentially breaking existing type annotations.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Add explicit type annotations for boto3 clients: `client: ImportExportClient = boto3.client(\"importexport\")` or `client: ImportExportClient = session.client(\"importexport\")`.","message":"For optimal IDE auto-completion and static analysis, it is recommended to explicitly type-hint `boto3.client` and `session.client` calls with the specific `Client` type (e.g., `ImportExportClient`). While `mypy` can often infer types, explicit annotations provide clearer guidance.","severity":"gotcha","affected_versions":"All"},{"fix":"Wrap type-only imports within a `if TYPE_CHECKING:` block:\n```python\nfrom typing import TYPE_CHECKING\nif TYPE_CHECKING:\n    from mypy_boto3_importexport import ImportExportClient\n```","message":"When using Pylint with `mypy-boto3` stubs, you might encounter 'undefined variable' warnings for imported types (e.g., `ImportExportClient`) in runtime code. This happens because stubs are only for type-checking and not available at runtime.","severity":"gotcha","affected_versions":"All"},{"fix":"Prefer `pip install 'boto3-stubs[service]'` or `pip install mypy-boto3-service` for individual service stubs, or `pip install types-boto3` for a global package.","message":"The `mypy-boto3` legacy packages have been moved to a separate product in `mypy-boto3-builder 8.9.0`. The recommended approach is to use `boto3-stubs` (which `mypy-boto3-importexport` is effectively a part of) or `types-boto3` for global stubs, or install individual service stubs directly.","severity":"deprecated","affected_versions":"mypy-boto3-builder >= 8.9.0"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}