cassandra-driver

Apache Cassandra Python Driver

79 个版本 Python >=3.10
安装
pip install cassandra-driver
poetry add cassandra-driver
pipenv install cassandra-driver
conda install cassandra-driver
描述

.. |license| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg :target: https://opensource.org/licenses/Apache-2.0 .. |version| image:: https://badge.fury.io/py/cassandra-driver.svg :target: https://badge.fury.io/py/cassandra-driver .. |pyversion| image:: https://img.shields.io/pypi/pyversions/cassandra-driver.svg .. |travis| image:: https://api.travis-ci.com/datastax/python-driver.svg?branch=master :target: https://travis-ci.com/github/datastax/python-driver

|license| |version| |pyversion| |travis|

Apache Cassandra Python Driver

A modern, feature-rich <https://github.com/datastax/python-driver#features>_ and highly-tunable Python client library for Apache Cassandra (2.1+) and DataStax Enterprise (4.7+) using exclusively Cassandra's binary protocol and Cassandra Query Language v3.

The driver supports Python 3.10 through 3.14.

Note: DataStax products do not support big-endian systems.

Features

  • Synchronous <https://docs.datastax.com/en/developer/python-driver/latest/api/cassandra/cluster/index.html#cassandra.cluster.Session.execute>_ and Asynchronous <https://docs.datastax.com/en/developer/python-driver/latest/api/cassandra/cluster/index.html#cassandra.cluster.Session.execute_async>_ APIs
  • Simple, Prepared, and Batch statements <https://docs.datastax.com/en/developer/python-driver/latest/api/cassandra/query/index.html#cassandra.query.Statement>_
  • Asynchronous IO, parallel execution, request pipelining
  • Connection pooling <https://docs.datastax.com/en/developer/python-driver/latest/api/cassandra/cluster/index.html#cassandra.cluster.Cluster.get_core_connections_per_host>_
  • Automatic node discovery
  • Automatic reconnection <https://docs.datastax.com/en/developer/python-driver/latest/api/cassandra/policies/index.html#reconnecting-to-dead-hosts>_
  • Configurable load balancing <https://docs.datastax.com/en/developer/python-driver/latest/api/cassandra/policies/index.html#load-balancing>_ and retry policies <https://docs.datastax.com/en/developer/python-driver/latest/api/cassandra/policies/index.html#retrying-failed-operations>_
  • Concurrent execution utilities <https://docs.datastax.com/en/developer/python-driver/latest/api/cassandra/concurrent/index.html>_
  • Object mapper <https://docs.datastax.com/en/developer/python-driver/latest/object_mapper/>_
  • Connecting to DataStax Astra database (cloud) <https://docs.datastax.com/en/developer/python-driver/latest/cloud/>_
  • DSE Graph execution API
  • DSE Geometric type serialization
  • DSE PlainText and GSSAPI authentication

Installation

Installation through pip is recommended::

$ pip install cassandra-driver

For more complete installation instructions, see the installation guide <https://docs.datastax.com/en/developer/python-driver/latest/installation/index.html>_.

Documentation

The documentation can be found online here <https://docs.datastax.com/en/developer/python-driver/latest/index.html>_.

A couple of links for getting up to speed:

  • Installation <https://docs.datastax.com/en/developer/python-driver/latest/installation/index.html>_
  • Getting started guide <https://docs.datastax.com/en/developer/python-driver/latest/getting_started/index.html>_
  • API docs <https://docs.datastax.com/en/developer/python-driver/latest/api/index.html>_
  • Performance tips <https://docs.datastax.com/en/developer/python-driver/latest/performance/index.html>_

Object Mapper

cqlengine (originally developed by Blake Eggleston and Jon Haddad, with contributions from the community) is now maintained as an integral part of this package. Refer to documentation here <https://docs.datastax.com/en/developer/python-driver/latest/object_mapper/index.html>_.

Contributing

See CONTRIBUTING.rst <https://github.com/datastax/python-driver/blob/master/CONTRIBUTING.rst>_.

Reporting Problems

Please report any bugs and make any feature requests on the CASSPYTHON project <https://issues.apache.org/jira/issues/?jql=project%20%3D%20CASSPYTHON%20ORDER%20BY%20key%20DESC>_ of the ASF JIRA.

If you would like to contribute, please feel free to open a pull request.

Getting Help

You can talk about the driver, ask questions and get help in the #cassandra-drivers channel on ASF Slack <https://the-asf.slack.com/>_.

License

Copyright 2013 The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

版本列表
3.30.0 2026-04-16
3.29.3 2025-10-22
3.29.2 2024-09-10
3.29.1 2024-03-20
3.29.0 2023-12-21
3.28.0 2023-06-06
3.27.0 2023-05-02
3.26.0 2023-03-28
3.25.0 2022-04-20
3.24.0 2020-06-18
3.23.0 2020-04-06
3.22.0 2020-02-26
3.21.0 2020-01-15
3.20.2 2019-11-19
3.20.1 2019-11-06
3.20.0 2019-10-28
3.19.0 2019-08-26
3.18.0 2019-05-27
3.17.1 2019-05-02
3.17.0 2019-02-19
3.16.0 2018-11-12
3.15.1 2018-09-06
3.15.0 2018-08-30
3.14.0 2018-04-17
3.13.0 2018-01-30
3.12.0 2017-11-06
3.11.0 2017-07-24
3.10 2017-05-24
3.9.0 2017-04-11
3.8.1 2017-03-16
3.8.0 2017-02-21
3.7.1 2016-10-26
3.7.0 2016-09-13
3.6.0 2016-08-01
3.5.0 2016-06-27
3.4.1 2016-05-26
3.4.0 2016-05-24
3.3.0 2016-05-02
3.2.2 2016-04-19
3.2.1 2016-04-13
3.2.0 2016-04-12
3.2.0a1 2016-03-30
3.1.1 2016-03-14
3.1.0 2016-03-10
3.1.0a2 2016-02-04
3.1.0a1 2016-01-29
3.0.0 2015-11-24
3.0.0rc1 2015-11-09
3.0.0a3 2015-09-21
3.0.0a2 2015-08-24
3.0.0a1 2015-08-06
2.7.2 2015-09-14
2.7.1 2015-08-25
2.7.0 2015-08-25
2.6.0 2015-07-20
2.6.0c2 2015-06-25
2.6.0c1 2015-06-04
2.5.1 2015-04-23
2.5.0 2015-03-30
2.1.4 2015-01-26
2.1.3 2014-12-16
2.1.2 2014-10-16
2.1.1 2014-09-11
2.1.0 2014-08-07
2.1.0c1 2014-07-25
2.1.0b1 2014-07-11
2.0.2 2014-06-10
2.0.1 2014-05-28
2.0.0 2014-05-28
2.0.0b1 2014-05-06
1.1.2 2014-05-08
1.1.1 2014-04-17
1.1.0 2014-04-16
1.0.2 2014-03-04
1.0.1 2014-02-19
1.0.0 2014-01-29
1.0.0b7 2013-11-12
1.0.0b6 2013-10-22
1.0.0b5 2013-10-10