Lacking any good examples of how to use python’s couchdb module, I’ve managed to make pretty impressive progress (for me) on a 4th of July holiday.
I’ll try to recreated it here for others although I know it’ll be incomplete.
Consider it a syntactical example;
import couchdb
s = couchdb.Server(’http://localhost:5984/’) ##why can’t it default to this?
db = s['stock_values']
ids = []
stock_values = {}
for doc in db:ids.append(doc)
d = db[doc]
stock_values[d['symbol']] = d['historical_data']
More good examples are in the code;
http://code.google.com/p/couchdb-python/source/browse/trunk/couchdb/client.py?r=61

{ 2 } Comments
why do you need a database for your couches? do you really have that many to keep track of?
Silly Chris,
couchdb is for geeks!
http://incubator.apache.org/couchdb/docs/overview.html
Picture simplicity as an evolutionary trait and apply it to databases.
We’re not yet sure if it’ll yield a failed branch of a full trunk but it’s a great exploration!
{ 1 } Trackback
[...] you’ve seen from my previous posts I’ve been playing with python, couchdb and been working my way through the “Programming Collective Intelligence” book. [...]
Post a Comment