Registry /
type-stubs / mypy-boto3-opensearchserverless
Install & Compatibility
Where this runs
tested against v1.43.17 · 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.602s · 116.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.9s · import 0.580s · 114MB
114MB installed
● package 114MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
OpenSearchServiceServerlessClient
✓ from mypy_boto3_opensearchserverless.client import OpenSearchServiceServerlessClient
✗ from boto3.opensearchserverless import OpenSearchServiceServerlessClient
Type stubs are imported from the 'mypy_boto3_servicename' package, not directly from 'boto3'.
TypeDefs
✓ from mypy_boto3_opensearchserverless.type_defs import CreateCollectionRequestTypeDef
✗ from boto3.opensearchserverless.type_defs import CreateCollectionRequestTypeDef
All generated type definitions (for request/response bodies, etc.) reside in the `type_defs` submodule of the stub package.
This quickstart demonstrates how to instantiate a type-hinted OpenSearchServiceServerless client using `boto3` and its corresponding `mypy-boto3` stub. It includes an example API call (`list_collections`) and illustrates how to use `TYPE_CHECKING` for optimal type inference. Remember to configure your AWS credentials for actual execution.
import boto3
from typing import TYPE_CHECKING
# Import the specific client stub for type annotation
from mypy_boto3_opensearchserverless.client import OpenSearchServiceServerlessClient
# To make mypy aware of the typed client, use TYPE_CHECKING
if TYPE_CHECKING:
client: OpenSearchServiceServerlessClient = boto3.client("opensearchserverless")
else:
client = boto3.client("opensearchserverless")
# Example usage: listing collections
try:
# This call will be type-checked based on the stub annotations
response = client.list_collections(maxResults=1)
print(f"First collection details: {response.get('collectionDetails', [])}")
except Exception as e:
print(f"Error listing collections (expected if no auth/resources configured): {e}")
# Example of using a TypeDef (e.g., for creating a collection)
# from mypy_boto3_opensearchserverless.type_defs import CreateCollectionRequestTypeDef
#
# # mypy will validate the structure of this dictionary
# collection_config: CreateCollectionRequestTypeDef = {
# "name": "my-typed-collection",
# "type": "SEARCH",
# "description": "A collection created with type-checked parameters"
# }
# print(f"Collection configuration: {collection_config}")
Debug
Known issues
breakingPython 3.8 is no longer supported. `mypy-boto3-builder` (which generates these stubs) removed support for Python 3.8 across all packages, migrating to PEP 561.fixUpgrade your Python environment to 3.9 or newer. Ensure your `requires_python` matches.
affects: >=8.12.0 (builder version, corresponds to stub versions 1.42.x and higher)
breakingType Definition names for method arguments may have changed, becoming shorter. For example, `CreateDistributionRequestRequestTypeDef` might become `CreateDistributionRequestTypeDef`.fixReview your code for `TypeDef` imports and usage, updating names to reflect the simplified structure.
affects: >=8.9.0 (builder version, check specific stub versions for impact)
gotchaThis package provides only type stubs. The actual `boto3` library must be installed separately for your code to run.fixEnsure you `pip install boto3` alongside `mypy-boto3-opensearchserverless`.
affects: All versions
gotchaWhile the stubs provide type hints, `mypy` itself is required to perform static type checking. Simply installing the stubs does not automatically enable type checks.fixInstall `mypy` (`pip install mypy`) and run `mypy your_script.py` to leverage the type annotations.
affects: All versions
Upgrade
Version history
1.43.17latest on PyPI · released May 28, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3; boto3 itself must be installed to run your code.
mypyoptionalmypy is the static type checker that utilizes these stubs for analysis.