forked from couchbase/couchbase-python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
0 parents
commit 0b69dd0
Showing
7 changed files
with
4,061 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.