Created
August 27, 2012 13:20
-
-
Save gustavofonseca/3488348 to your computer and use it in GitHub Desktop.
listagens do books em csv
This file contains hidden or 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 couchdbkit | |
BASE_URL = 'http://books.scielo.org/id/%s' | |
server = couchdbkit.Server(uri='http://192.168.1.12:5984/') | |
db = server['scielobooks_1a'] | |
print 'sbid|title|url' | |
for book in db.view('books/published_books', include_docs=True): | |
row = [book['id'], book['value'].get('title'), BASE_URL % book['id']] | |
print '|'.join(row).encode('utf-8') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment