This scripts reads EXIF data from your photos and generates CSV file or Pandas dataframe with day by day location in terms of country.
It relies on my package exif2pandas. It uses reverse-geocoder to convert GPS data to country codes. That module uses a csv file with 150k cities and then uses nearest neighbour algorithm to find the position of each gps data point. This sometimes does not work in border regions so if you are seeing bad data the easiest fix is to copy cities.csv and add your village etc.
In case some of your photos contain bad gps data that show that you have been to countries where you have never been you can use ignore_countries argument.
Generated world map with colored regions according to how many days you have spent in the country.
id,from,to,days,country,country_code
4,2015-11-07,2015-11-09,1,Scotland,GB
5,2015-11-09,2015-12-12,32,Praha,CZ
6,2015-12-12,2015-12-12,0,Budapest,HU
7,2015-12-12,2015-12-12,0,Praha,CZ
8,2015-12-12,2015-12-15,2,Budapest,HU
note that the country column is usually wrong - this is because the cities.csv is not consisent with administrative boundaries beyond country_code.
Finally there is a raw dataframe with exif data per image file:
See example.ipynb for example graphs and data frames exported.
Python 3.9 or higher
See PYPI Python package.
pip install photos-wherephotos_where Dropbox/Photos/2020/
ls where
cities-pie.jpg
countries-pie.jpg
intervals.csv
location-by-day.csv
photos.feather
years.jpg
world.svg# Specify custom output directory
photos_where /path/to/photos -o /path/to/output
# Cache EXIF data to feather file for faster re-runs
photos_where /path/to/photos -f /path/to/cache.feather
# Ignore specific countries (by country code)
photos_where /path/to/photos -i US GB
# Use multiple processes for faster EXIF extraction
photos_where /path/to/photos -p 10This project uses UV for dependency management and has locked dependencies for reproducible builds.
# Clone the repository
git clone https://github.com/visgean/where.git
cd where
# Install UV if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create virtual environment and install dependencies
uv venv
uv pip install -e .
# Run the tool
uv run photos_where example_photos/
# Run tests (if any)
uv run pytestThe uv.lock file ensures all contributors use the same dependency versions for consistent behavior.



