Book review: Flask: Building Python Webservices

I’m thinking of writing a Web service for a project of mine. For this purpose, I wanted to learn Flask (and a bunch of other technologies), as Flask seems well established and well documented. This is a book from Packt that agglomerates 3 previously released books. One of the main questions is the relevance of them as the Flask API evolves.

Discussion

I was mostly interested in the first book, Flask By Example. The book starts progressively, with basic Flask tools, like templates and static files. I have to say that there are some preliminary gaps there, as CSS is introduced as inlined only for a long time, but then we get the end of the book, we do get all the information we need.

I liked the fact that we go through 3 different hands-on applications that can help us understand how to secure the app, how to login and how to add Google Maps. The last one is a little bit of advertisement, I think, and not something fundamental, but it helps introducing databases in the mix.

The second book is just a cookbook. There are lots of details that I haven’t followed because I didn’t choose the extensions that are advertised here, there are also bits that are obsolete like all the extensions namespaces (just moved like scikits, from a shared flask.ext to a flask_, or the manager interfaces that seem to be now native. Still, the pattern can be followed.

The real bummer here is that testing is just a small part of one of the final sets of recipes, When testing should be one of the most important sets, and perhaps even the first one. No differentiations between different types of testings that need to be covered for a web application.

The third book kind of reiterates what the first book did with a few additional functionalities like Blueprints (I don’t think we had them) or task queues. Once again, testing is only tackled as a second-zone citizen and without all the aspects that would be required.

Conclusion

There are several parts of the book that are obsolete, and there are also duplicates, but let’s say that the first two books complement each other quite well. There are bits missing or incomplete, like testing, and JWT, but it still a good first introduction. The last one adds on top of the first for some specifics but it’s far less useful, as lots of the codes needs to be updated. I suppose the second edition fixed things there, but we only have the first one here.

http://www.amazon.com/dp/ASIN/9781787288225?tag=matbrusblo05-21http://www.amazon.com/dp/ASIN/B0722JYY9D?tag=matbrusblo05-21

1 thought on “Book review: Flask: Building Python Webservices

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.