Last active
August 29, 2015 13:56
-
-
Save fabiobatalha/9249996 to your computer and use it in GitHub Desktop.
Tabula livros armazenados no couchdb
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
# 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