Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Cassandra Query Language driver

Project description

A Python driver for CQL that adheres to py-dbapi v2
(PEP249, Python Database API Specification v2.0: http://www.python.org/dev/peps/pep-0249/).

Standard use:
>> import cql
>> con = cql.connect(host, port, keyspace)
>> cursor = con.cursor()
>> cursor.execute("CQL QUERY", {kw=Foo, kw2=Bar, etc...})

- cursor.description # None initially, list of N tuples that represent
the N columns in a row after an execute. Only
contains type and name info, not values.
- cursor.rowcount # -1 initially, N after an execute
- cursor.arraysize # variable size of a fetchmany call
- cursor.fetchone() # returns a single row
- cursor.fetchmany() # returns self.arraysize # of rows
- cursor.fetchall() # returns all rows, don't do this.

>> cursor.execute("ANOTHER QUERY", **more_kwargs)
>> for row in cursor: # Iteration is equivalent to lots of fetchone() calls
>> doRowMagic(row)

>> cursor.close()
>> con.close()

Query substitution:
- Use named parameters and a dictionary of names and values.
e.g. execute("SELECT * FROM CF WHERE name=:name", name="Foo")

Project details


Release history Release notifications

History Node

1.4.0

History Node

1.3.0

History Node

1.2.0

History Node

1.1.0

History Node

1.0.10

History Node

1.0.9

History Node

1.0.8

History Node

1.0.7

This version
History Node

1.0.6

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
cql-1.0.6.tar.gz (43.7 kB) Copy SHA256 hash SHA256 Source None Nov 10, 2011

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page