connect cassandra to flask
Usage
This is an example flask app that reads from a Cassandra cluster:
from flask import Flask
from flask_cassandradb import CassandraCluster
app = Flask(__name__)
cassandra = CassandraCluster()
app.config['CASSANDRA_NODES'] = ['cassandra01.flyzen.com'] # can be a string or list of nodes
app.config['CASSANDRA_KEYSPACE'] = 'pythonista' # default keyspace
@app.route("/cassandra_test")
def cassandra_test():
session = cassandra.connect("monty_python") # connect to the monty_python keyspace, it not specified will use the default keyspace.
cql = "SELECT * FROM sketches LIMIT 1"
r = session.execute(cql)
return str(r[0])
if __name__ == '__main__':
app.run()
Installation
$ pip install flask-cassandradb
Requirements
Compatibility
Licence
Metadata
Release files for Flask-CassandraDB 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| Flask-CassandraDB-0.0.1.tar.gz | 2.6 kB | Without provenance | Details |
Release files / Flask-CassandraDB-0.0.1.tar.gz
| Download URL | Flask-CassandraDB-0.0.1.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
678b9c21a5ff6828d863cd9e51f460b96716f962171967286cebe12cf809fc06
|
|
BLAKE2b-256 checksum How to use checksums |
bb777c8e7258b6200a6d5b69b9f9179bbf986ed4cc6b182a6c54ae7ad6e6b96c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Flask-CassandraDB 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.