{"id":13937090,"url":"https://github.com/pycassa/pycassa","last_synced_at":"2025-07-19T23:30:32.857Z","repository":{"id":62052559,"uuid":"443845","full_name":"pycassa/pycassa","owner":"pycassa","description":"Python Thrift driver for Apache Cassandra","archived":true,"fork":false,"pushed_at":"2019-05-29T05:04:17.000Z","size":2445,"stargazers_count":500,"open_issues_count":12,"forks_count":142,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-06-26T22:56:29.163Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pycassa.github.io/pycassa/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pycassa.png","metadata":{"files":{"readme":"README.mkd","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-12-20T16:39:06.000Z","updated_at":"2025-05-04T19:17:46.000Z","dependencies_parsed_at":"2022-10-25T18:45:42.643Z","dependency_job_id":null,"html_url":"https://github.com/pycassa/pycassa","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/pycassa/pycassa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycassa%2Fpycassa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycassa%2Fpycassa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycassa%2Fpycassa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycassa%2Fpycassa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pycassa","download_url":"https://codeload.github.com/pycassa/pycassa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycassa%2Fpycassa/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266041680,"owners_count":23867944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-07T23:03:16.860Z","updated_at":"2025-07-19T23:30:32.401Z","avatar_url":"https://github.com/pycassa.png","language":"Python","readme":"pycassa\n=======\n\n[![Build Status](https://secure.travis-ci.org/pycassa/pycassa.png?branch=master)](http://travis-ci.org/pycassa/pycassa)\n\npycassa is a Thrift-based python client library for [Apache Cassandra](http://cassandra.apache.org)\n\n**pycassa does not support CQL** or Cassandra's native protocol, which are a\nreplacement for the Thrift interface that pycassa is based on. If you are\nstarting a new project, **it is highly recommended that you use the newer**\n[DataStax python driver](https://github.com/datastax/python-driver) instead\nof pycassa.\n\npycassa is open source under the [MIT license](http://www.opensource.org/licenses/mit-license.php).\n\nDocumentation\n-------------\n\nDocumentation can be found here:\n\n[http://pycassa.github.com/pycassa/](http://pycassa.github.com/pycassa/)\n\nIt includes [installation instructions](http://pycassa.github.com/pycassa/installation.html),\na [tutorial](http://pycassa.github.com/pycassa/tutorial.html),\n[API documentation](http://pycassa.github.com/pycassa/api/index.html),\nand a [change log](http://pycassa.github.com/pycassa/changelog.html).\n\nGetting Help\n------------\n\nIRC:\n\n* Use the #cassandra channel on irc.freenode.net. If you don't have an IRC client,\n  you can use [freenode's web based client](http://webchat.freenode.net/?channels=#cassandra).\n\nMailing List:\n\n* User list: [http://groups.google.com/group/pycassa-discuss](http://groups.google.com/group/pycassa-discuss)\n* Developer list: [http://groups.google.com/group/pycassa-devel](http://groups.google.com/group/pycassa-devel)\n\nInstallation\n------------\n\nIf pip is available, you can install the lastest pycassa release\nwith:\n\n    pip install pycassa\n\nIf you want to install from a source checkout, make sure you have Thrift\ninstalled, and run setup.py as a superuser:\n\n    pip install thrift\n    python setup.py install\n\nBasic Usage\n-----------\n\nTo get a connection pool, pass a Keyspace and an optional list of servers:\n\n~~~~~~ {python}\n\u003e\u003e\u003e import pycassa\n\u003e\u003e\u003e pool = pycassa.ConnectionPool('Keyspace1') # Defaults to connecting to the server at 'localhost:9160'\n\u003e\u003e\u003e\n\u003e\u003e\u003e # or, we can specify our servers:\n\u003e\u003e\u003e pool = pycassa.ConnectionPool('Keyspace1', server_list=['192.168.2.10'])\n~~~~~~\n\nTo use the standard interface, create a ColumnFamily instance.\n\n~~~~~~ {python}\n\u003e\u003e\u003e pool = pycassa.ConnectionPool('Keyspace1')\n\u003e\u003e\u003e cf = pycassa.ColumnFamily(pool, 'Standard1')\n\u003e\u003e\u003e cf.insert('foo', {'column1': 'val1'})\n\u003e\u003e\u003e cf.get('foo')\n{'column1': 'val1'}\n~~~~~~\n\ninsert() will also update existing columns:\n\n~~~~~~ {python}\n\u003e\u003e\u003e cf.insert('foo', {'column1': 'val2'})\n\u003e\u003e\u003e cf.get('foo')\n{'column1': 'val2'}\n~~~~~~\n\nYou may insert multiple columns at once:\n\n~~~~~~ {python}\n\u003e\u003e\u003e cf.insert('bar', {'column1': 'val3', 'column2': 'val4'})\n\u003e\u003e\u003e cf.multiget(['foo', 'bar'])\n{'foo': {'column1': 'val2'}, 'bar': {'column1': 'val3', 'column2': 'val4'}}\n\u003e\u003e\u003e cf.get_count('bar')\n2\n~~~~~~\n\nget_range() returns an iterable. You can use list() to convert it to a list:\n\n~~~~~~ {python}\n\u003e\u003e\u003e list(cf.get_range())\n[('bar', {'column1': 'val3', 'column2': 'val4'}), ('foo', {'column1': 'val2'})]\n\u003e\u003e\u003e list(cf.get_range(row_count=1))\n[('bar', {'column1': 'val3', 'column2': 'val4'})]\n~~~~~~\n\nYou can remove entire keys or just a certain column:\n\n~~~~~~ {python}\n\u003e\u003e\u003e cf.remove('bar', columns=['column1'])\n\u003e\u003e\u003e cf.get('bar')\n{'column2': 'val4'}\n\u003e\u003e\u003e cf.remove('bar')\n\u003e\u003e\u003e cf.get('bar')\nTraceback (most recent call last):\n...\npycassa.NotFoundException: NotFoundException()\n~~~~~~\n\nSee the [tutorial](http://pycassa.github.com/pycassa/tutorial.html#connecting-to-cassandra) for more details.\n","funding_links":[],"categories":["资源列表","Database Drivers","Python"],"sub_categories":["数据库驱动"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycassa%2Fpycassa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpycassa%2Fpycassa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycassa%2Fpycassa/lists"}