Install & Compatibility
Where this runs
tested against v4.0.2 · 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
py 3.10
✕ build_error
✓ 5.2s
py 3.11
✕ build_error
✓ 4.6s
py 3.13
✕ build_error
✓ 3.7s
83MB installed
● package 83MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SigV4AuthProvider
✓ from cassandra_sigv4.auth import SigV4AuthProvider
✗ from cassandra_sigv4 import SigV4AuthProvider
In older versions the symbol was at package level, but since 4.0.0 it moved to a submodule. The old import will raise ImportError.
Connects to Amazon Keyspaces using SigV4 authentication. Ensure AWS credentials are available via environment, IAM role, or boto3 session.
import boto3
from cassandra.cluster import Cluster
from cassandra_sigv4.auth import SigV4AuthProvider
# AWS credentials (region is required; credentials from env or boto3 session)
boto_session = boto3.Session()
auth_provider = SigV4AuthProvider(boto_session=boto_session)
cluster = Cluster(
['cassandra.<region>.amazonaws.com'],
port=9142,
ssl_context=True,
auth_provider=auth_provider
)
session = cluster.connect()
row = session.execute('SELECT keyspace_name FROM system_schema.keyspaces').one()
print(row) # Expected: first keyspace
session.shutdown()
cluster.shutdown()
Errors
Common errors & fixes
cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'<host>:9142': ConnectionException('Failed to connect')})
SSL context not enabled or incorrect port. Amazon Keyspaces requires SSL on port 9142.
fixSet ssl_context=True and port=9142 in Cluster constructor.
AttributeError: module 'cassandra_sigv4' has no attribute 'SigV4AuthProvider'
Import path changed in version 4.0.0. The class moved to a submodule.
fixUse 'from cassandra_sigv4.auth import SigV4AuthProvider' instead of 'from cassandra_sigv4 import SigV4AuthProvider'.
TypeError: __init__() missing 1 required keyword-only argument: 'boto_session'
SigV4AuthProvider requires boto_session or other parameters (like credentials) in newer versions.
fixPass a boto3.Session object: SigV4AuthProvider(boto_session=boto3.Session())
boto3.exceptions.NoRegionError: You must specify a region.
No AWS region configured. The plugin needs a region from environment, boto session, or hostname.
fixSet AWS_DEFAULT_REGION environment variable, or create boto3 session with region_name='us-east-1'.
Upgrade
Version history
4.0.2latest on PyPI · released Oct 30, 2020
Audit
Dependencies
cassandra-driverrequiredRequired runtime dependency: this plugin is an authentication provider for the DataStax Python driver.
boto3optionalUsed to obtain AWS credentials and region. Required unless custom credentials are provided.