skillfed

cassandra-driver

Apache Cassandra Python Driver

cassandra-driver v3.30.1 8.8M downloads/30d#1,595 on PyPI1,427
Permissive license Apache-2.0 Active released

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-driver

uv

uv add cassandra-driver

poetry

poetry add cassandra-driver

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Tags

cassandra python clientcql query drivercassandra connection poolingasync cassandra queriescassandra orm mapperdse python drivercassandra batch statements
cassandradistributed-databaseasync-io

More Python Modules packages