Jump to ratings and reviews
Rate this book

Python Requests Essentials

Rate this book
Learn how to integrate your applications seamlessly with web services using Python Requests About This Book A fast-paced guide that demonstrates the use of Python Requests with the help of examples Learn web scraping with Beautiful Soup and Python Requests libraries Interact with social networking sites such as Facebook, Twitter, and Reddit to retrieve data from them Who This Book Is For

If you are a Python administrator or developer interested in interacting with web APIs and have a passion for creating your own web applications, this is the book for you. Basic knowledge of Python programming, APIs, and web services will be an advantage.

What You Will Learn Demonstrate the use of Python Requests with the help of examples Use the Requests module to deal with the inner sections of the request-response cycles Implement the RESTful Web API with Python Requests Authenticate Requests using different authentication methods Emulate server actions and interact with a mock server Interact with social networking sites such as Facebook, Twitter, and reddit Scrape the Web with Python Requests and BeautifulSoup Build your own web application with Flask In Detail

Python is one of the most popular programming languages of our era; the Python Requests library is one of the world's best clients, with the highest number of downloads. It allows hassle-free interactions with web applications using simple procedures.

You will be shown how to mock HTTP Requests using HTTPretty, and will learn to interact with social media using Requests. This book will help you to grasp the art of web scraping with the BeautifulSoup and Python Requests libraries, and will then paddle you through Requests impressive ability to interact with APIs. It will empower you with the best practices for seamlessly drawing data from web apps. Last but not least, you will get the chance to polish your skills by implementing a RESTful Web API with Python and Flask!

Kindle Edition

First published June 17, 2015

3 people are currently reading
3 people want to read

About the author

Rakesh Vidya Chandra

2 books2 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
0 (0%)
4 stars
0 (0%)
3 stars
3 (50%)
2 stars
1 (16%)
1 star
2 (33%)
Displaying 1 - 2 of 2 reviews
Profile Image for Jascha.
151 reviews
April 27, 2016
Most of the Pythonists out there will probably tell you that they like Python because it's easy to learn. On the contrary of them, what I enjoy most about the language is the great variety of libraries available, ranging from network up to web programming, passing through data analysis and machine learning. Among them is the Requests library, a third-party jewel that, in a world where everything is connected to the Internet, makes it easy for us all to work with the HTTP(s) protocol without worrying with its quirks and intricacies. Python Requests Essentials is the only book available on the market fully dedicated to this library.

Released in the summer of 2015, Python Requests Essentials is a short title that targets a small niche of intermediate Pythonists, those interested in communicating with some external web service through HTTP(s). But while on the one hand it is taken for granted that the reader knows the basics of the language, on the other hand the most important concepts of the HTTP protocol are quickly refreshed by the author.

As stated, it is a very short book, which spans through only 140 pages, divided into 7 chapters—what can be delivered in roughly 20 pages per chapter? Quickly moving through the table of contents we can see the authors' choice to cover the internals of the Requests library in two chapters only and to dedicate all the others to see it in action, doing some goodd web scraping and analysing the social media. Fine, so time to dive into the contents.

The very first chapter does nothing but show how Requests makes the life of a developer easier over the good old urllib. The same example is solved using each library in such a way that Requests looks awesomely better. The urllib code is indeed unnecessarily complicated, thus achieving the planned result. Chapter 2 and 3 dissect an HTTP transaction through the Requests library. These are, as said already, the only chapters where the reader is shown the internals of the library and how to use it to build HTTP requests, as well as deal with a response. The authors show plenty of examples—don't get too exited, more on them in a minute—covering different scenarios, including downloading and uploading files, filling forms and dealing with (continuous) streams. Customization of an HTTP request is also presented.

Unit testing is important. We all do it, don't we? Since it is such an essential step in the development of great software, what follows is a chapter dedicated to HTTPretty used to mock HTTP requests. Nothing wrong with it. Still, Pythonists have many other options, including HTTP Mock. It owuld have been interesting to see the most important ones compared and their use with Requests. The remaining chapters briefly show the readers how to combine Requests with other Python utils, such as Beautiful Soup or Flask, to built on top of third-party web services. The topics covered are interesting, no doubts. Despite this, most of the pages are dedicated to explain basic concepts such as what is web scraping or Flask, resulting in very little said about the topic of the chapter itself.

Overall the book provides little or nothing more than the official documentation. Many concepts are taken into the discussion, but almost no details are given, as if the whole book were Chapter 1, where the subject is quickly introduced. The examples, well, there are indeed plenty of examples throughout these seven chapters, but apart rare occasions, do not expect anything that goes beyond four lines. No real world examples, just tons of "hello world" like one liners that show little or nothing at all, and that certainly do not go beyond what the official documentation shows already.

Before tying it all up a couple of notes. First, the book shows proofreading problems, which shows poor caring and definitely lowers the overall value. And second, the price is quite absurd for such a tiny book, given its content. Not suggested, even at a lower price. The official documentation and Stack Overflow provide much better details and examples for free.

As usual, you can find more reviews on my personal blog: books.lostinmalloc.com. Feel free to pass by and share your thoughts!
Profile Image for Paul Childs.
183 reviews3 followers
January 9, 2017
Short book with mostly brief examples on how to use some Python modules such as Request, BeautifulSoup, and Flask. If you know nothing about these things then this is probably a fair way to start if you don't have to pay full price for the book. I got the pdf on sale for $5, so I was okay with it. If I had paid full price I would have been less pleased.

If you already have some knowledge of these modules, than this book is probably too basic for you. At best this book is a primer. It never digs deep into any of the topics that it discusses.
Displaying 1 - 2 of 2 reviews

Can't find what you're looking for?

Get help and learn more about the design.