Skip to main content

Official Python Couchbase Client

Project description

pylibcouchbase
==============

This is an experimental repository for the next generation Couchbase Python
SDK which is based on [libcouchbase][1].

The couchbase.pxd was automatically generated by a [cwrap branch that uses
libclang][2].

NOTE: When generating the `libcouchbase.pxd` file, you _must_ add the text
`nogil` at the end of the line declaring `lcb_wait`.


Prerequisites
-------------

Install libcouchbase.


Building
--------

In order to build this client, you need to have `libcouchbase` installed. Once
this is done, you can now build the extension.

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:

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.


Running sample application
--------------------------

To run the small sample application that inserts one million documents into
a local Couchbase at the default port 8091 and a bucket called "default",
just execute:

python examples/basic.py


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:

make html

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


Running tests
-------------

The tests need a running Couchbase instance. The values to connect to the
instance can be found in the test configuration file `tests/tests.ini`.

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:

python tests/setup_tests.py

To run the tests:

nosetests

Tested platforms
----------------

So far the code has been tested on the following platforms/environments.

Linux 64-bit (with GCC):
- Python 2.7.3
- Python 3.2.3
- Python 2.6.6

Mac OS X 10.6.8
- Python 2.6.1
- Python 3.3.1

Microsoft Windows 2008 R2 (MSVC 2008/VC9)
- Python 2.7.3 (x86)
- Python 2.7.4 (x64)


If you ran it on a different platform and it worked, please let me know and
I'll add it to the list.


License
-------

pylibcouchbase is licensed under the Apache License 2.0.



[1]: https://github.com/couchbase/libcouchbase

Project details


Release history Release notifications | RSS feed

This version

0.10

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

couchbase-0.10.tar.gz (54.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page