This Python script, named "image_metadata.py", allows you to extract EXIF data, including GPS coordinates, from an image file using the Python Imaging Library (PIL) and the Geopy library. It also includes functions to convert GPS coordinates from degrees, minutes, and seconds format to decimal degrees, and to retrieve the address of the location based on the extracted GPS coordinates using Nominatim geocoding service. The script catches common exceptions, such as IOError, AttributeError, KeyError, and IndexError, and provides error handling. This script can be useful for extracting metadata from images and obtaining location information from GPS coordinates embedded in image EXIF data.
- Create and active virtualenv.
python3 -m venv .env source .env/bin/active
- Install dependencies.
pip install -r requirements.txt
- Run as you wish!