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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 198.8MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.7s · import 0.000s · 267MB
232MB installed
● package 232MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
KeyspacesClient
✓ from mypy_boto3_keyspaces.client import KeyspacesClient
✗ from mypy_boto3_keyspaces import KeyspacesClient
Client
✓ from mypy_boto3_keyspaces.client import KeyspacesClient as Client
ServiceResource
✓ from mypy_boto3_keyspaces.service_resource import KeyspacesServiceResource
This quickstart demonstrates how to use `mypy-boto3-keyspaces` with `boto3`. The `if TYPE_CHECKING:` block ensures that the type stub imports are only processed by static analysis tools like `mypy`, avoiding any runtime overhead. Remember to replace `my_keyspace` with an actual Keyspaces keyspace and ensure AWS credentials are configured for the `boto3` client to function correctly.
import boto3
from mypy_boto3_keyspaces.client import KeyspacesClient
from typing import TYPE_CHECKING
import os
# Configure AWS credentials and region if not already set via environment variables or ~/.aws/credentials
# For example, using environment variables:
# os.environ['AWS_ACCESS_KEY_ID'] = 'YOUR_ACCESS_KEY'
# os.environ['AWS_SECRET_ACCESS_KEY'] = 'YOUR_SECRET_KEY'
# os.environ['AWS_REGION'] = 'us-east-1'
if TYPE_CHECKING:
# mypy will use these imports for type checking
client: KeyspacesClient = boto3.client("keyspaces", region_name=os.environ.get('AWS_REGION', 'us-east-1'))
# Example: List tables (requires appropriate IAM permissions)
try:
response = client.list_tables(keyspaceName='my_keyspace')
print("Tables:", response.get("TableNames"))
except Exception as e:
print(f"Error listing tables: {e}")
else:
# Runtime code doesn't strictly need the mypy-boto3 imports
client = boto3.client("keyspaces", region_name=os.environ.get('AWS_REGION', 'us-east-1'))
# Example: List tables
try:
response = client.list_tables(keyspaceName='my_keyspace')
print("Tables:", response.get("TableNames"))
except Exception as e:
print(f"Error listing tables: {e}")
print("Code execution finished. Run `mypy your_script.py` for type checking.")
Debug
Known issues
breakingSupport for Python 3.8 was removed starting with `mypy-boto3-builder` version 8.12.0. If you are using `mypy-boto3-keyspaces` generated by this builder version or later, Python 3.9+ is required.fixUpgrade your Python environment to 3.9 or higher. Alternatively, pin your `mypy-boto3-keyspaces` version to an older release compatible with Python 3.8.
affects: >=8.12.0 (builder version, affects generated packages)
breakingTypeDef naming conventions changed significantly with `mypy-boto3-builder` version 8.9.0. Many TypeDefs that previously had a `Request` suffix at the end (e.g., `CreateDistributionRequestRequestTypeDef`) were shortened or had suffixes moved for consistency.fixUpdate your import paths and variable annotations to match the new TypeDef names. Refer to the specific service's documentation on the `mypy-boto3` GitHub for exact changes.
affects: >=8.9.0 (builder version, affects generated packages)
gotchaFor type checking a specific AWS service (like Keyspaces), you must install its dedicated `mypy-boto3-servicename` package (e.g., `mypy-boto3-keyspaces`), not just `boto3-stubs` or `mypy-boto3-builder`.fixAlways install the specific service stub package relevant to your `boto3` client calls, e.g., `pip install mypy-boto3-keyspaces`.
affects: all
gotchaType checking only occurs when `mypy` is explicitly run on your code. Installing `mypy-boto3-keyspaces` provides the stubs, but `mypy` must be installed and executed for static analysis.fixEnsure `mypy` is installed (`pip install mypy`) and run it from your project root: `mypy your_script.py` or `mypy .`.
affects: all
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3's Keyspaces service client. boto3 itself is required for runtime execution.
mypyoptionalmypy is the static type checker that utilizes these stubs. It is a tool dependency, not a runtime dependency.