Book Image

Python for Secret Agents

By : Steven F. Lott, Steven F. Lott
Book Image

Python for Secret Agents

By: Steven F. Lott, Steven F. Lott

Overview of this book

Table of Contents (12 chapters)
Python for Secret Agents
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Solving problems – closest good restaurant


We want to meet our secret informant at a good restaurant that's a reasonable distance from our base. In order to locate a good restaurant, we need to gather some additional information. In this case, good means a passing grade from the health inspectors.

Before we can even have a meeting, we'll need to use basic espionage skills to locate the health code survey results for local restaurants.

We'll create a Python application to combine many things to sort through the results. We'll perform the following steps:

  1. We'll start with the restaurant health score information.

  2. We need to geocode the restaurant addresses if it hasn't been done already. In some cases, geocoding is done for us. In other cases, we'll be using a web service for this.

  3. We need to filter and organize restaurants by good scores. We'll also need to use our haversine() function to compute the distance from our base.

  4. Finally, we need to communicate this to our network, ideally using a short...