Skip to content

Instantly share code, notes, and snippets.

@fabiobatalha
Last active August 29, 2015 13:56
Show Gist options
  • Save fabiobatalha/9249996 to your computer and use it in GitHub Desktop.
Save fabiobatalha/9249996 to your computer and use it in GitHub Desktop.
Tabula livros armazenados no couchdb
# coding: utf-8
import json
import urllib2
books = json.loads(urllib2.urlopen('http:/127.0.0.1:5984/scielobooks_1a/_design/scielobooks/_view/books').read())
for row in books['rows']:
print u'|'.join(
[
row['value'].get('title', 'not defined'),
row['value'].get('year', 'not defined'),
str(row['value'].get('is_comercial', 'not defined'))
]
).encode('utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment