Proposed Python SDK API

This is about designing the API for the next generation Python SDK for Couchbase. In the end the API might look the same as the current one, or be completely different. Feel free to come up with any ideas.

To make it easier to get a feeling on what the API might look like I'll list a few API calls from different SDKs.

"Python" describes the current API, "Python vmx" is what Volker Mische has in mind. Add your own ideas, leave comments or sent an email to the Couchbase Group.

Connect to a bucket

The Python has the concept of a Server Connection where you can select buckets from. In the Ruby and PHP you connect directly to a bucket.

Python

Python vmx

Following the way Ruby is doing it, keeping the bucket concept, but different from the old Python API.

cb = Couchbase.connect(ip:port, username, password, bucket)

The connect will be an instance of the Bucket class. This way the API can be expanded in the future to do administrative tasks on the cluster that are not bucket specific.

Ruby

In Ruby there are essentially two ways, with a string to the REST end-point of a bucket, or with a hash, or combined way, where you can use string URI and override its parts with options. Also it is possible to specify set of nodes as array.