Skip to main content

Bottle plugin for Cassandra/Pycassa

Project description

bottle-pycassa
==============

Plugin for bottle to allow for cassandra connection pools

Usage example:
```
import bottle
from bottle import run, get
from bottle import HTTPError
from bottle.ext import pycassa
from pycassa.pool import ConnectionPool
from pycassa.columnfamily import ColumnFamily
from pycassa import NotFoundException

pool = ConnectionPool("my_keyspace",
['127.0.0.1'],
pool_timeout = 5, pool_size=24)

app = bottle.Bottle()
plugin = pycassa.Plugin(pool, keyword="cass")
app.install(plugin)


@app.get('/:query')
def show(query, cass):
my_column_family = ColumnFamily(cass, 'my_column_family')

try:
result = my_column_family.get(1167864277)
return result
except NotFoundException, nfe:
return HTTPError(404, 'Entity not found.')

run(app=app, host='localhost', port=80, reloader=True)

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

bottle-pycassa-0.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page