Retrieve list of buckets in cluster using Python SDK


I’m attempting to retrieve a list of buckets in a cluster using the Python SDK, but so far can’t find out exactly how to get it…

I’m currently setting up a connection to my cluster using

cluster = Cluster('couchbase://localhost')
authenticator = PasswordAuthenticator('admin', 'password')

but I don’t see any way to list the buckets available on the cluster. Is there a way to do it, or am I stuck heading out to the CLI for that option?


Hi, I’m afraid you are correct that there isn’t a direct way to retrieve a list of buckets in a cluster in Python. We do store the list in the _buckets member variable as an implementation detail but this isn’t supposed to be used externally. The supported way would be to use the REST API:

However, I will add this feature for the next release, which should be in the next week or two. Here is the JIRA:

Many thanks,



Hi Ellis,

That sounds great, thank you for the swift action.

To extend on the question, is there a way to list production views on a bucket, or it that doable through the REST API as well?

Stefan Finseth


Hi, I’m not aware of such a function - you would need to use REST calls for that, I think, for now. These look like the relevant endpoints: