cassandra-driver
Apache Cassandra Python Driver
What it is and what it does
cassandra-driver is the official Apache Cassandra Python client, maintained by DataStax. It provides both synchronous and asynchronous APIs for executing CQL queries against Cassandra clusters, with built-in connection pooling, automatic node discovery, and configurable load balancing and retry policies. The driver handles the binary protocol communication directly and supports prepared statements, batch operations, and concurrent execution utilities.
The package includes an integrated object mapper (cqlengine) for mapping Python classes to Cassandra tables, making it suitable for both low-level query control and higher-level ORM workflows. It supports DataStax Astra (cloud), DSE Graph execution, geometric type serialization, and multiple authentication schemes. Runtime dependencies are minimal (geomet and Deprecated), keeping the footprint lean.
Use it for:
- Building Python applications that query and write to Apache Cassandra or DataStax Enterprise clusters using CQL.
- Implementing object-relational mapping for Cassandra tables via cqlengine without a separate ORM library.
- Executing asynchronous batch operations and concurrent queries to maximize throughput in data pipelines.
- Connecting to DataStax Astra cloud databases from Python applications.
- Handling automatic failover and reconnection in distributed Cassandra deployments.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python client library for Apache Cassandra and DataStax Enterprise that provides synchronous and asynchronous APIs for executing CQL queries, managing connections, and mapping objects to database tables.
Yes. cassandra-driver is the official, actively maintained client for Cassandra in Python, with no known vulnerabilities, permissive licensing, and broad platform support. Install friction is moderate but manageable via prebuilt wheels. Choose it if you need to query Cassandra or DSE; it is the standard choice for this use case.
Install
cassandra-driver on PyPI
pip
pip install cassandra-driveruv
uv add cassandra-driverpoetry
poetry add cassandra-driverInstalling cassandra-driver
Before you install
Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.10, 3.11, 3.12, and 3.13 on macOS (Intel and ARM), Linux (x86_64 and aarch64), and Windows. Active maintenance with a recent release 39 days ago and ongoing repository activity.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions; suitable for proprietary projects.
Quickstart
pip install cassandra-driver
from cassandra.cluster import Cluster
cluster = Cluster(['localhost'])
session = cluster.connect()
rows = session.execute('SELECT * FROM system.local')
for row in rows:
print(row)
Requires a running Cassandra (2.1+) or DataStax Enterprise (4.7+) instance accessible on the network; Python 3.10 or later required.
Verify before relying
- Whether the object mapper (cqlengine) is production-ready for all use cases or has known limitations.
- Performance characteristics under high concurrency or large result sets compared to alternatives.
- Support status for PyPy beyond the classifier listing.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — geomet, Deprecated |
| Maintenance | actively maintained — 39 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,784,794/month — #1,595 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cassandra_driver-3.30.1-cp310-cp310-macosx_10_9_x86_64.whl; cassandra_driver-3.30.1-cp310-cp310-macosx_11_0_arm64.whl; cassandra_driver-3.30.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cassandra_driver-3.30.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cassandra_driver-3.30.1-cp310-cp310-win_amd64.whl; cassandra_driver-3.30.1-cp311-cp311-macosx_10_9_x86_64.whl; cassandra_driver-3.30.1-cp311-cp311-macosx_11_0_arm64.whl; cassandra_driver-3.30.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cassandra_driver-3.30.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cassandra_driver-3.30.1-cp311-cp311-win_amd64.whl; cassandra_driver-3.30.1-cp312-cp312-macosx_10_13_x86_64.whl; cassandra_driver-3.30.1-cp312-cp312-macosx_11_0_arm64.whl; cassandra_driver-3.30.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cassandra_driver-3.30.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cassandra_driver-3.30.1-cp312-cp312-win_amd64.whl; cassandra_driver-3.30.1-cp313-cp313-macosx_10_13_x86_64.whl; cassandra_driver-3.30.1-cp313-cp313-macosx_11_0_arm64.whl; cassandra_driver-3.30.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cassandra_driver-3.30.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cassandra_driver-3.30.1-cp313-cp313-win_amd64.whl
Keywords: cassandra, cql, orm, dse, graph
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
cassandra-sigv4Adds AWS Signature Version 4 authentication to…
permissive · top 15,000 on PyPI
cassiocassIO integrates Apache Cassandra with machine…
permissive · top 15,000 on PyPI
cqlshcqlsh is a command-line client for executing…
permissive · top 15,000 on PyPI
scylla-driverA Python client library for querying and…
permissive · top 5,000 on PyPI
acsyllaAcsylla is an async Python client library for…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-cassandraAdds distributed tracing instrumentation to…
permissive · top 5,000 on PyPI
astrapyAstraPy is a Python client library for DataStax…
permissive · top 15,000 on PyPI
apache-airflow-providers-apache-cassandraIntegrates Apache Cassandra with Apache…
permissive · top 15,000 on PyPI
langchain-astradbIntegrates Astra DB (a serverless vector…
permissive · top 15,000 on PyPI
neo4j-driverPython driver for connecting to and querying…
permissive · top 15,000 on PyPI