forked from couchbase/couchbase-python-client
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.txt
34 lines (27 loc) · 1.17 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
========================
COUCHBASE PYTHON LIBRARY
========================
This library provides mothods to connect to both the couchbase
memcached interface and the couchbase rest api interface.
Two simple use cases to set and get a key in the default bucket
and then create a new bucket::
#!/usr/bin/env python
from couchbase.couchbaseclient import VBucketAwareCouchbaseClient
from couchbase.couchbaseclient import MemcachedTimeoutException
from couchbase.rest_client import RestConnection
client = VBucketAwareCouchbaseClient("http://localhost:8091/pools/default","default","",False)
client.set("key1", 0, 0, "value1")
client.get("key1")
server_info = {"ip":"localhost",
"port":8091,
"username":"Administrator",
"password":"password"}
rest = RestConnection(server_info)
rest.create_bucket(bucket='newbucket',
ramQuotaMB=100,
authType='none',
saslPassword='',
replicaNumber=1,
proxyPort=11215,
bucketType='membase')
This version requires Python 2.6 or later