How apache/cassandra-python-driver works
This repository is the Apache Cassandra Python Driver: applications issue CQL or graph requests and receive results through synchronous or asynchronous APIs. The main runtime path is Cluster/Session request handling, host selection and connection pooling, binary-protocol encoding and transport, then response decoding. The graph also preserves the documented object mapper, cloud connections, graph API, authentication, and concurrency capabilities. Several feature branches are documented or indexed but not fully sampled, so their uncertain internal call paths are omitted.
Main entry points: cluster.py Cluster and Session · connection.py Connections and IO · protocol.py Binary Protocol · models.py Mapper Models
Components 24
Driver Runtime
- Cluster and Session
cassandra/cluster.py - CQL Statements
cassandra/query.py - Routing Policies
cassandra/policies.py - Cluster Metadata
cassandra/metadata.py - Connection Pools
cassandra/pool.py - Connections and IO
cassandra/connection.py - Async Reactors
cassandra/io - Binary Protocol
cassandra/protocol.py - CQL Encoding
cassandra/encoder.py - CQL Types
cassandra/cqltypes.py - Value Marshalling
cassandra/marshal.py
Object Mapper
- Mapper Models
cassandra/cqlengine/models.py - Mapper Columns
cassandra/cqlengine/columns.py - Mapper QuerySets
cassandra/cqlengine/query.py - Mapper Connections
cassandra/cqlengine/connection.py - Schema Management
cassandra/cqlengine/management.py
Graph API
- Graph Requests
cassandra/datastax/graph/query.py - GraphSON Serialization
cassandra/datastax/graph/graphson.py - Fluent Graph API
cassandra/datastax/graph/fluent/_query.py
Integrations
- Astra Cloud Setup
cassandra/datastax/cloud/__init__.py - Authentication
cassandra/auth.py - Concurrent Utilities
cassandra/concurrent.py
Other components
- Application
- Cassandra Cluster
Connections 28
- Application → Cluster and Session: opens session
- Application → CQL Statements: submits CQL
- Cluster and Session → Routing Policies: configures routing
cassandra/cluster.py - Cluster and Session → Cluster Metadata: updates topology
cassandra/cluster.py - Cluster and Session → Connection Pools: manages pools
cassandra/cluster.py - Cluster and Session → Connections and IO: dispatches requests
cassandra/cluster.py - Connection Pools → Connections and IO: acquires connections
cassandra/pool.py - Connections and IO → Binary Protocol: sends protocol frames
cassandra/connection.py - Connections and IO → Async Reactors: uses IO reactor
cassandra/connection.py - Binary Protocol → CQL Types: encodes type values
cassandra/protocol.py - Binary Protocol → Value Marshalling: marshals values
cassandra/protocol.py - Cluster and Session → CQL Statements: executes statements
cassandra/cluster.py - CQL Statements → CQL Encoding: encodes parameters
cassandra/query.py - CQL Encoding → CQL Types: uses type codecs
cassandra/encoder.py - Connections and IO → Cassandra Cluster: exchanges binary protocol
- Application → Mapper Models: defines mapped models
- Mapper Models → Mapper Columns: declares columns
cassandra/cqlengine/models.py - Mapper Models → Mapper QuerySets: exposes queries
cassandra/cqlengine/models.py - Mapper QuerySets → Mapper Connections: executes mapper queries
cassandra/cqlengine/query.py - Mapper Connections → Cluster and Session: creates driver session
cassandra/cqlengine/connection.py - Application → Schema Management: manages schema
- Application → Graph Requests: submits graph traversal
- Graph Requests → GraphSON Serialization: serializes graph values
cassandra/datastax/graph/query.py - Fluent Graph API → Graph Requests: builds graph queries
cassandra/datastax/graph/fluent/_query.py - Application → Astra Cloud Setup: configures cloud access
- Application → Authentication: provides credentials
- Cluster and Session → Authentication: uses auth provider
cassandra/cluster.py - Application → Concurrent Utilities: runs concurrent work