Install & Compatibility
Where this runs
tested against v1.43.0 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.628s · 52MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.7s · import 0.566s · 53MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
B2BIClient
✓ from mypy_boto3_b2bi.client import B2BIClient
✗ from boto3.client import B2BIClient
The type stubs are provided by `mypy_boto3_b2bi`, not directly by `boto3`'s runtime components. Explicitly importing the `B2BIClient` type from the stub package enables static type checking.
paginate
✓ from mypy_boto3_b2bi.paginator import ListPartnershipsPaginator
Accessing paginator types for specific operations.
waiter
✓ from mypy_boto3_b2bi.waiter import SomeResourceExistsWaiter
Accessing waiter types for specific operations. (Note: B2BI may not have waiters)
This quickstart demonstrates how to instantiate a B2BI client from `boto3` and apply the `mypy-boto3-b2bi` type annotations. It performs a simple `list_partnerships` operation, showcasing how static analysis can infer types for client methods and response structures.
import boto3
from mypy_boto3_b2bi import B2BIClient
from typing import Dict, Any
# The actual client comes from boto3. The B2BIClient type from mypy_boto3_b2bi
# is used to provide type hints for static analysis.
try:
# Assuming AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)
client: B2BIClient = boto3.client("b2bi")
# Example operation: List Partnerships
# mypy will now validate the parameters and the structure of the response.
response = client.list_partnerships(
MaxResults=5 # Optional: limit the number of results
)
partnerships = response.get('partnerships', [])
print(f"Found {len(partnerships)} B2BI partnerships.")
for partnership in partnerships:
print(f" - Partnership ID: {partnership.get('partnershipId')}, Name: {partnership.get('name')}")
except Exception as e:
print(f"An error occurred: {e}")
print("Ensure 'boto3' and 'mypy-boto3-b2bi' are installed and AWS credentials are configured.")
Debug
Known issues
breakingThe `mypy-boto3-builder` (version 8.12.0, which generated mypy-boto3-b2bi 1.42.3) removed support for Python 3.8 and migrated to PEP 561 package standards. Projects still on Python 3.8 or relying on older package structures will encounter import or runtime errors.fixUpgrade your project's Python version to 3.9 or newer. Ensure your package manager (e.g., pip) is up-to-date to correctly handle PEP 561 packages.
affects: mypy-boto3-builder >= 8.12.0 (and generated stubs like mypy-boto3-b2bi >= 1.42.x)
gotcha`mypy-boto3-b2bi` provides only type stubs. For the code to run, the actual `boto3` library must be installed. The stubs themselves do not include the AWS SDK functionality.fixAlways install `boto3` alongside `mypy-boto3-b2bi` using `pip install boto3 mypy-boto3-b2bi`.
affects: All versions
gotchaSignificant version mismatches between `boto3` and `mypy-boto3-b2bi` can lead to incorrect or missing type hints, as the stubs are generated to match specific `boto3` service definitions.fixAim to keep `boto3` and `mypy-boto3-b2bi` versions as closely aligned as possible. Ideally, update them simultaneously or choose `mypy-boto3-b2bi` versions that explicitly state compatibility with your `boto3` version.
affects: All versions
breakingThe `mypy-boto3-builder` (from version 8.9.0) introduced changes to generated TypeDef naming conventions (e.g., shorter names, altered postfix placement). While specific examples may not be for B2BI, direct reliance on exact TypeDef names from previous versions may break after an upgrade.fixAfter updating, review any code that directly references generated TypeDef classes (e.g., for custom validation or mock objects) and adjust to the new naming conventions.
affects: mypy-boto3-builder >= 8.9.0 and subsequently generated stubs.
deprecatedSpecific AWS services may be renamed or deprecated, leading to their corresponding `mypy-boto3-*` stub packages being updated or removed (e.g., `sms-voice` replaced by `pinpoint-sms-voice` in builder v8.11.0). While not directly impacting B2BI currently, this indicates a general risk for other services.fixConsult `mypy-boto3-builder` release notes and AWS documentation when upgrading or if type errors appear unexpectedly for specific services.
affects: All versions, depending on AWS service updates.
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3optionalProvides the underlying AWS SDK client that these type stubs annotate. `boto3` must be installed and kept updated to match the stub versions for accurate type checking.