Skip to content
tmaesaka edited this page May 4, 2011 · 3 revisions

python-kyototycoon

Introduction goes here.

Simple Example

Set / Get Example

from kyototycoon import KyotoTycoon

kt = KyotoTycoon()

kt.open()
kt.set('key', 'abc')
value = kt.get('key')
kt.close()

Connecting to a specific server

By default, python-kyototycoon connects to the localhost on port 1978 (default port of Kyoto Tycoon). Alternatively, you can choose to connect to a server of your choice when you open a new connection.

kt.open(HOSTNAME, PORT_NUMBER)

Additionally, you can choose to specify a timeout (in seconds).

kt.open(HOSTNAME, PORT_NUMBER, TIMEOUT)

Data Serialization and Interoperability

By default, python-kyototycoon serializes data using the Python picke module. This means that by default, data sent over the wire / stored on Kyoto Tycoon can (generally) only be processed by Python. In order to achieve data interoperability, you can choose to use the optional JSON serializer or override the seralizer yourself. This functionality is currently in progress.

Type Aware Methods

Clone this wiki locally