Skip to content

Instantly share code, notes, and snippets.

@gadamc
Created February 9, 2012 17:17
Show Gist options
  • Save gadamc/1781322 to your computer and use it in GitHub Desktop.
Save gadamc/1781322 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from couchdbkit import Server, Database
s = Server('https://edwdbik.fzk.de:6984')
db = s['automat']
vr = db.view('cryo_2/getData2', reduce=False, descending=True, startkey=["T_PT1", 1318357552], endkey=["T_PT1", 1318357452])
values = []
for row in vr:
#the key returned by the view is a list of length two. the first element is the name of the variable and the second is the pc time
values.append( [ row['key'][1], row['value'] ] )
#values is now a list of x,y values
#for example
x = value[1][0]
y = value[1][1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment