Transform A 1 day project into a 10 days project



Transform A 1 day project into a 10 days project

0 0


100-best-books-presentation

Presentation of the Python 100 Best Books project http://www.100bestbooks.xyz

On Github benoitvallon / 100-best-books-presentation

Transform A 1 day project into a 10 days project

By Benoit (Summer2) / @benoitvallon

Cool it is gonna be a 1 day project :)

Call to the api

Cool still a 1 day project :)

APIs (or not) related to books

  • Open Library API
  • ISBNdb.com API
  • Google Book Data API
  • + 51 others according the Programmableweb

What do I have to do

  • Search for the book (isbn/title/author)
  • Get the number of pages
  • Get a cover image

Some tries

Some code

def requestIsbndb(book):
            pageName = book['title']
            pageName = pageName.replace("_", " ")

            if book['author'] != 'Unknow':
              pageName = pageName + " " + book['author']
            print book
            print pageName
            pageNameEncoded = urllib2.quote(pageName.encode('UTF-8'))
            print 'Request for: ' + pageNameEncoded
            isbndbXml = urllib2.urlopen("http://isbndb.com/api/v2/xml/" + current_app.config['ISBNDB_KEY'] + "/books?q=" + pageNameEncoded).read()

            bestResult = getIsbndbBestResult(isbndbXml)

            book['description'] = bestResult.find('physical_description_text').text
            isbn10 = bestResult.find('isbn10').text
            book['imageLink'] = "http://covers.openlibrary.org/b/isbn/" + isbn10 + ".jpg"

            return book

It has been 3-4 days, it's not fun anymore :(

Change your paradigm

Automatically vs Manually

Google App Engine feedback

  • No environment variable
  • Can not build assets

Conclusion

  • Sometimes do things manually

Thank you

www.100bestbooks.xyzSource code
Transform A 1 day project into a 10 days project By Benoit (Summer2) / @benoitvallon