Book Image

Python Network Programming

By : Abhishek Ratan, Eric Chou, Pradeeban Kathiravelu, Dr. M. O. Faruque Sarker
Book Image

Python Network Programming

By: Abhishek Ratan, Eric Chou, Pradeeban Kathiravelu, Dr. M. O. Faruque Sarker

Overview of this book

This Learning Path highlights major aspects of Python network programming such as writing simple networking clients, creating and deploying SDN and NFV systems, and extending your network with Mininet. You’ll also learn how to automate legacy and the latest network devices. As you progress through the chapters, you’ll use Python for DevOps and open source tools to test, secure, and analyze your network. Toward the end, you'll develop client-side applications, such as web API clients, email clients, SSH, and FTP, using socket programming. By the end of this Learning Path, you will have learned how to analyze a network's security vulnerabilities using advanced network packet capture and analysis techniques. This Learning Path includes content from the following Packt products: • Practical Network Automation by Abhishek Ratan • Mastering Python Networking by Eric Chou • Python Network Programming Cookbook, Second Edition by Pradeeban Kathiravelu, Dr. M. O. Faruque Sarker
Table of Contents (30 chapters)
Title Page
Copyright
About Packt
Contributors
Preface
Index

Searching Amazon for books through the product search API


If you like to search for products on Amazon and include some of them in your website or application, this recipe can help you to do that. We can see how to search Amazon for books.

Getting ready

This recipe depends on the third-party Python bottlenose library. You can install this library using pip, as shown in the following command:

$ pip install  bottlenose

First, you need to place your Amazon account's access key, secret key, and affiliate ID into local_settings.py. A sample settings file is provided with the book code. You can also edit this script and place it here as well.

How to do it...

We can use the bottlenose library that implements the Amazon's product search APIs.

Listing 7.6 gives the code for searching Amazon for books through product search APIs, as shown:

#!/usr/bin/env python 
# Python Network Programming Cookbook, Second Edition -- Chapter - 7 
# This program is optimized for Python 2.7.12 and Python 3.5.2. 
# It may run...