In [3]:
import csv
import sys
sys.path.append("..")
from gitenberg.util.catalog import BookMetadata
from gitenberg.book import Book
rdf_library='/Documents/gitenberg/cache/epub'
exit

with open('../gitenberg/data/GITenberg_repo_list.tsv','r') as f:
    for vals in csv.reader(f,delimiter='\t', quotechar='"'):
        (pg_id, repo_name) = vals
        if '-----' in repo_name:
            pg_book=Book(pg_id)
            pg_book.parse_book_metadata()
            print '{}\t{}'.format(pg_book.meta._repo,repo_name)
            break


0x30de0x30eb0x30c10x30f30x30eb0x30bf0x30fc0x306e0x5c0f0x4fe10x4ef00x554f0x7b540x66f8_2592	---------------_2592

In [4]:
from gitenberg.book import Book

book = Book(31434)
book.parse_book_metadata()
print book.meta._repo
print book.meta.alternative_title


Babylonia-or-the-corruption-of-the-Greek-language-in-various-places-A-Comedy-in-five-acts_31434
Babylonia; or, the corruption of the Greek language in various places.
A Comedy in five acts

In [ ]: