Introduction

Warning

This project has recently started. I don't recommend anyone use it just yet.

However, it is for anyone who wants to get involved in development, to give feedback, or are happy with it's very limited state.

Please check back often, I hope to get this to a generally useful state this year. Contributions, advice welcome, development is coodinated on github.

pysandra

pysandra - An asyncio based Cassandra client for Python.

Build Status Coverage Package version

The pysandra package can be used to create high-performance services that connect to cassandra using asyncio based concurency.

Let's get started...

This example works in python 3.7 or above (which introduced the asyncio.run() high level function, but still requires creating functions. To use async calls directly use ipython, or use Python 3.8 with python -m asyncio.

>>> import asyncio
>>> import pysandra
>>> async def test():
...    client = pysandra.Client(('localhost',9142), use_tls=True)
...    result = await client.execute("SELECT release_version FROM system.local")
...    print(list(result)[0][0]) # first row, first column
...
>>> asyncio.run(test())

Progress

In case you didn't read the notice, there's quite a limited set of functionality at the moment.

Things that exist:

  • asyncio interface
  • basic query support (with results into native python types)
  • basic DML support
  • basic DDL query
  • basic prepared statements
  • basic TLS support
  • ...
  • see protocol.md for more details

Things that don't exist:

  • any authentication support
  • sync support (version 2.0)
  • paging, batch support
  • stable api
  • friendly api
  • connection to more then one cluster member
  • ...
  • why are you still reading this.

Goals

  • cassandra client driver for asyncio based applications
  • allow doing anything the wire protocol allows and servers tolerate

License & Contributions

The pysandra project is dual-licensed under Apache 2.0 and MIT terms.

See COPYRIGHT for full details

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.