Skip to content
Provides a Flask extension to access Apache Cassandra databases
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Flask-Cassandra provides an application-level connection to an Apache Cassandra database. This connection can be used to interact with a Cassandra cluster.

Flask-Cassandra requires both Flask and the Datastax Python Driver for Apache Cassandra to be installed. This driver will be installed automatically when installing via pip or when running install.


The easiest way to use the extension is to install it from PyPI using pip:

$ pip install flask-cassandra

You can also install the extension directly from source.

$ python install


This is an example flask app that reads from a Cassandra cluster.

from flask import Flask
from flask_cassandra import CassandraCluster

app = Flask(__name__)
cassandra = CassandraCluster()

app.config['CASSANDRA_NODES'] = ['']  # can be a string or list of nodes

def cassandra_test():
    session = cassandra.connect()
    cql = "SELECT * FROM sketches LIMIT 1"
    r = session.execute(cql)
    return str(r[0])

if __name__ == '__main__':


If you would like to extend the functionality of the extension, pull requests are most welcome.

You can’t perform that action at this time.