Chapter 12: Extracting Geolocation and Metadata from Documents, Images, and Browsers

 

  1. Which Python module allows us to retrieve geographic information from an IP address?

pygeoip allows you to retrieve geographic information from an IP address. It is based on GeoIP databases, which are distributed in several files depending on their type (the types are city, region, country, ISP).

 

  1. Which module uses Google Geocoding API v3 services to retrieve the coordinates of a specific address?

pygeocoder is a Python module that facilitates the use of Google's geolocation functionality. With this module, you can easily find addresses corresponding to coordinates and vice versa. We can also use it to validate and format addresses.

  1. What is the main class of the pygeocoder module that allows queries to be made both from the description of a place and from a specific location?

The main class of this module is the Geocoder class, which allows queries to be made both from the description of a place and from a specific location.

 

  1. Which method allows the reversal of a process to recover the address of a given site from the coordinates corresponding to latitude and longitude?

results = Geocoder.reverse_geocode(results.latitude, results.longitude)

  1. Which method within the pygeoip module allows us to obtain the value of the country name from the IP address passed by the parameter?

country_name_by_addr(<ip_address>)

 

  1. Which method within the pygeoip module allows us to obtain a structure in the form of a dictionary with the geographic data (country, city, area, latitude, longitude) from the IP address?

record_by_addr(<ip_address>)

 

  1. Which method within the pygeoip module allows us to obtain the name of the organization from the domain name?

org_by_name(<domain_name>)

 

  1. Which Python module allows us to extract metadata from PDF documents?

PyPDF2

 

  1. Which class and method can we use to obtain information from a PDF document?

The PyPDF2 module offers the ability to extract document information as well as encrypt and decrypt documents. To extract metadata, we can use the PdfFileReader class and the getDocumentInfo() method, which return a dictionary with the document data.

 

  1. Which module allows us to extract image information from tags in EXIF format?

PIL.ExifTags is used to obtain the EXIF tags information of an image; the _getexif() method of the image object can be used. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.191.134