Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
There's just enough to see if things work on all supported
platforms. You should be able to compile and run it the
normal distutils way.

The example program is called basic.py. It does insert
one million items into a local Couchbase instance on the
default port 8091.
  • Loading branch information
vmx committed Mar 22, 2013
0 parents commit 0b69dd0
Show file tree
Hide file tree
Showing 7 changed files with 4,061 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
pylibcouchbase
==============

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

The lcb.c was automatically generate by a [cwrap branch that uses libclang][2].


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

Install libcouchbase.


Building
--------

As the target audience is currently developers, you probably want to install
it locally. You can run:

python setup.py build_ext --inplace

If you have compile libcouchbase yourself at a custom location, you can pass
it in via the `CFLAGS` and `LDFLAGS` environment variables.


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

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

python basic.py


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

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

Linux 64-bit:

- Python 2.7.3
- Python 3.2.3

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



[1]: https://github.com/couchbase/libcouchbase
[2]: https://github.com/geggo/cwrap
9 changes: 9 additions & 0 deletions basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from lcb import Couchbase

cb = Couchbase('127.0.0.1:8091')
cb.connect()

for i in range(0, 1000000):
key = 'please-' + str(i)
value = '{"it": "works", : ' + str(i) + '}'
cb.set(key, value)
Loading

0 comments on commit 0b69dd0

Please sign in to comment.