Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install couchbase

How to install couchbase

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install couchbase
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0.0 Failed View build log
0.7.1.post1 Failed View build log
Windows (64-bit)
1.0.0 Failed View build log
Mac OS X (10.5+)
1.0.0 Failed View build log
0.7.1.post1 Failed View build log
Linux (32-bit)
0.8.1
1.0.0 Failed View build log
0.8.1 Available View build log
0.8.0 Available View build log
0.7.2 Available View build log
0.7.1.post1 Failed View build log
0.7.0 Available View build log
Linux (64-bit)
0.8.1
1.0.0 Failed View build log
0.8.1 Available View build log
0.8.0 Available View build log
0.7.2 Available View build log
0.7.1.post1 Failed View build log
0.7.0 Available View build log
1.0.0 Failed View build log
 
Author
License
Apache License 2.0
Depended by
Lastest release
version 1.0.0 on Jul 6th, 2013

Client for Couchbase.

Building and Installing

This only applies to building from source. If you are using a Windows installer then everything (other than the server) is already included. See below for windows snapshot releases.

Also note that these instructions apply to building from source. You can always get the latest supported release version from PyPi

Prerequisites
Building

System Message: ERROR/3 (<string>, line 33)

Unknown directive type "code-block".

.. code-block:: sh

    python setup.py build_ext --inplace


If your libcouchbase install is in an alternate location (for example, /opt/local/libcouchbase), you may add extra directives, like so

System Message: ERROR/3 (<string>, line 41)

Unknown directive type "code-block".

.. code-block:: sh

    python setup.py build_ext --inplace \
        --library-dir /opt/local/libcouchbase/lib \
        --include-dir /opt/local/libcouchbase/include

Or you can modify the environment CFLAGS and LDFLAGS variables.

Windows Snapshots

A list of recent snapshot builds for Windows may be found here <http://packages.couchbase.com/clients/python/snapshots>.

You can always get release binaries from PyPi (as above).

Using

Here's an example code snippet which sets a key and then reads it

System Message: ERROR/3 (<string>, line 66)

Unknown directive type "code-block".

.. code-block:: pycon

    >>> from couchbase import Couchbase
    >>> c = Couchbase.connect(bucket='default')
    >>> c
    <couchbase.connection.Connection bucket=default, nodes=['127.0.0.1:8091'] at 0xb21a50>
    >>> c.set("key", "value")
    OperationResult<RC=0x0, Key=key, CAS=0x31c0e3f3fc4b0000>
    >>> res = c.get("key")
    >>> res
    ValueResult<RC=0x0, Key=key, Value=u'value', CAS=0x31c0e3f3fc4b0000, Flags=0x0>
    >>> res.value
    u'value'
    >>>

You can also use views

System Message: ERROR/3 (<string>, line 83)

Unknown directive type "code-block".

.. code-block:: pycon

    >>> from couchbase import Couchbase
    >>> c = Couchbase.connect(bucket='beer-sample')
    >>> resultset = c.query("beer", "brewery_beers", limit=5)
    >>> resultset
    View<Design=beer, View=brewery_beers, Query=Query:'limit=5', Rows Fetched=0>
    >>> for row in resultset: print row.key
    ...
    [u'21st_amendment_brewery_cafe']
    [u'21st_amendment_brewery_cafe', u'21st_amendment_brewery_cafe-21a_ipa']
    [u'21st_amendment_brewery_cafe', u'21st_amendment_brewery_cafe-563_stout']
    [u'21st_amendment_brewery_cafe', u'21st_amendment_brewery_cafe-amendment_pale_ale']
    [u'21st_amendment_brewery_cafe', u'21st_amendment_brewery_cafe-bitter_american']


Other Examples

There are other examples in the examples directory.

Building documentaion

The documentation is using Sphinx and also needs the numpydoc Sphinx extension. To build the documentation, go into the docs directory and run

System Message: ERROR/3 (<string>, line 113)

Unknown directive type "code-block".

.. code-block:: sh

    make html

The HTML output can be found in docs/build/html/.

Testing

The tests need a running Couchbase instance. For this, a tests/tests.ini file must be present, containing various connection parameters. An example of this file may be found in tests/tests.ini.sample. You may copy this file to tests/tests.ini and modify the values as needed.

The test suite need several buckets which need to be created before the tests are run. They will all have the common prefix as specified in the test configuration file. To create them, run:

System Message: ERROR/3 (<string>, line 133)

Unknown directive type "code-block".

.. code-block:: sh

    python tests/setup_tests.py

To run the tests:

nosetests

Support

If you found an issue, please file it in our JIRA. You may also ask in the #libcouchbase IRC channel at freenode. (which is where the author(s) of this module may be found).

License

The Couchbase Python SDK is licensed under the Apache License 2.0.

Subscribe to package updates

Last updated Jul 6th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.