Registry / type-stubs / mypy-boto3-elbv2

mypy-boto3-elbv2

JSON →
library1.43.54pypypi✓ verified 23d ago

mypy-boto3-elbv2 provides static type annotations for the boto3 ElasticLoadBalancingv2 (ELBv2) service, generated with mypy-boto3-builder 8.12.0. This package enhances developer experience by enabling type checking, autocompletion, and error detection in IDEs for boto3 clients, paginators, waiters, and type definitions related to AWS ELBv2. The current version is 1.42.3, and it follows the boto3 versioning with frequent updates to align with new AWS service features.

pip install mypy-boto3-elbv2
INSTALL
IMPORT
SIG · MYPY-BOTO3-ELBV2
M
mypy-boto3-elbv2
type-stubspythonv1.43.54
Install
3.5s avg
Import
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.54 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.9MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.5s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ElasticLoadBalancingv2Client
from mypy_boto3_elbv2 import ElasticLoadBalancingv2Client
from mypy_boto3_elbv2 import ElasticLoadBalancingv2Client

This quickstart demonstrates how to initialize a type-hinted ELBv2 client and use it to describe load balancers, leveraging the provided type definitions for improved code quality and IDE support.

import boto3 from mypy_boto3_elbv2.client import ElasticLoadBalancingv2Client from mypy_boto3_elbv2.type_defs import DescribeLoadBalancersOutputTypeDef def get_elbv2_client() -> ElasticLoadBalancingv2Client: """Returns a typed ELBv2 client.""" # boto3-stubs provides auto-discovery for Session.client # For standalone mypy-boto3-elbv2, explicit typing is recommended. client: ElasticLoadBalancingv2Client = boto3.client("elbv2") return client def list_load_balancers(): client = get_elbv2_client() try: response: DescribeLoadBalancersOutputTypeDef = client.describe_load_balancers() for lb in response.get("LoadBalancers", []): print(f"Load Balancer ARN: {lb['LoadBalancerArn']}, Name: {lb['LoadBalancerName']}") except client.exceptions.LoadBalancerNotFoundException: print("No load balancers found.") except Exception as e: print(f"An error occurred: {e}") if __name__ == "__main__": list_load_balancers()
Debug
Known issues
breakingSupport for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 or older must upgrade to Python 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or a newer supported version.
affects: >=8.12.0 of mypy-boto3-builder (which generated mypy-boto3-elbv2 1.42.3 and newer)
breakingVersion 8.9.0 of `mypy-boto3-builder` introduced breaking changes in TypeDef naming conventions. Specifically, TypeDefs for packed method arguments use shorter names (`CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes were moved to the end (`CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`).
fix
Review and update any custom code directly referencing affected `TypeDef` names.
affects: >=8.9.0 of mypy-boto3-builder (which generated mypy-boto3-elbv2 from that point)
gotchaFor optimal IDE autocompletion and type checking, especially when using `mypy-boto3-elbv2` as a standalone package or `boto3-stubs-lite`, it is often necessary to explicitly annotate the client type (e.g., `client: ElasticLoadBalancingv2Client = boto3.client("elbv2")`). While `boto3-stubs` (the meta-package) aims for implicit type discovery, explicit annotations provide the most reliable experience.
fix
Use explicit type annotations for boto3 clients, resources, paginators, and waiters, especially when passing them between functions or storing them.
affects: All versions
gotchaThe version of `mypy-boto3-elbv2` is synchronized with the `boto3` version it provides stubs for (e.g., `mypy-boto3-elbv2 1.42.3` corresponds to `boto3 1.42.3`). Ensure your `mypy-boto3-elbv2` version matches or is compatible with your installed `boto3` version to avoid type checking inconsistencies.
fix
Align `mypy-boto3-elbv2` installation with your `boto3` installation. The recommended `boto3-stubs[elbv2]` installation method helps manage this.
affects: All versions
deprecatedThe original `mypy-boto3` top-level package is considered legacy. While `mypy-boto3-elbv2` (the service-specific stub) is still actively maintained and generated by `mypy-boto3-builder`, users are encouraged to use the `boto3-stubs` or `types-boto3` packages (e.g., `pip install 'boto3-stubs[elbv2]'`) for a more consolidated and officially recommended approach to type annotations.
fix
Consider migrating to `boto3-stubs` or `types-boto3` if you are managing type annotations for multiple boto3 services.
affects: All versions
Upgrade
Version history
1.43.54latest on PyPI · released Jul 22, 2026
Audit
Dependencies
boto3requiredRuntime dependency for actual AWS interaction; this package only provides type stubs.
pythonrequiredRequired Python version.
Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
2
Resources
mypy-boto3-elbv2 — pip install mypy-boto3-elbv2 · libregistry